Cursor Teleport

How could I make it so that I could teleport to where my cursor is looking at?

1 Like

Great question, @Shadow!

As this is a common form of locomotion in VR, it would be great to be able to do this in CoSpaces.

The question we need to ask is, “Is it possible to get the XY coordinate of the pointer?”, because if we can, then we can move the camera there.

The answer is “by using the RayCast API, we can get the coordinates of where the pointer touches another Item”, which is a long way of saying “sometimes”.

The floor of an environment is not an Item, but we can create an artificial floor using a 2D square or circle from Library > Building.

Search this forum for “RayCast” for more info and code examples.

Hope this helps! Let me know if you have any further questions. If this post solves your problem, please mark it as the Solution.

Many thanks,

Geoff@TechLeap

1 Like