- Home /
Manipulating cursor direction in 3D space
I'm currently working on a point-and-click physics based game. To do this, I've created a cursor game object that's to represent the cursor and be able to interact with other objects.
My problem is that I have the cursor able to move up and down in space, as well as forward and back while it's colliding with the ground, but instead of moving towards the camera in the mouse's true position, it instead trails off screen unless perfectly perpendicular with the camera.
I've tried to implement a "pinch" that would restrict the cursor's x-axis as it got closer to the camera, creating the illusion that the cursor is always perpendicular. This however created an unwanted curved effect as seen here: https://i.gyazo.com/8b47e4265b713b0b4e689f14f3c97e41.gif
What I want is for the cursor to move straight towards the camera, staying in range with the actual cursor- instead of trailing off into an offscreen perspective.
I'd like for it to look more like this, without any curve: https://i.gyazo.com/3d710dcba7707d50d37cfc75b00e7a13.gif
Your answer
Follow this Question
Related Questions
Help needed moving this gameobject 0 Answers
How to lock a transform's local up axis rotation on any surface 1 Answer
How to find a prefab's location relative to the origin? 0 Answers
force too -z ax 1 Answer
How to lock axis for LookAt? 1 Answer