Item follow mouse using raycast please help!

@techleapnz i forgot the code for the mouse follow raycast thing, i think the ability to have an item follow the mouse is really cool!!! can you maybe like send me the code or example project?

Many thanks, @EricTheDragon

Hi @EricTheDragon,

You can remix CoSpaces Edu :: Follow the mouse with Scripting to learn how to use the RayCast API to get the position of your mouse.

Hope that helps! Let me know if you have any further questions about this.

Many thanks,
Geoff @ TechLeap

1 Like

@techleapnz How do you make the raycast grid visible though?

@EricTheDragon, there’s no such thing as a raycast grid. The RayCast.cast API will return either return a hit when an object is hit, or null. The grid in the editor is a visual aid for aligning objects.

Geoff @ TechLeap

@techleapnz

But there’s like this grid thing in this “Minecraft grids demo game”

That grid is the result of setting the spacing and the dimensions of the cubes to be the same, and rounding the spacing to the nearest unit (1.0, from memory).

Geoff