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
Sam Wronski
Maker of things, currently helping build cloud things @ Google. World of Zero is a personal project disconnected from my professional work. Lets make something awesome together!