This page looks best with JavaScript enabled

Lets Make Spawning Objects with Raycasts and Keyboard Events

 ·   ·  ☕ 1 min read

Making a simple tool to allow us to bind KeyCode’s to Prefabs and instantiate them easily in our game. Something quick and dirty that ought to make testing a lot easier.

To do this we’ll play with Camera’s ScreenPointToRay and some basic raycasting as well as creating a Map between keycodes and prefabs. This will allow us to easily create new objects based on keys we select. It’s designed to be simple, but powerful.

If you have any ideas for new projects we should look into leave a comment below! I’m always looking for fun new things to try.


Sam Wronski
WRITTEN BY
Sam Wronski
Maker of things and professional software engineer. Lets make something awesome together!