One of the solutions i came up with is while turning only rotate the camera but not the ship, but before i have to do that i would like to see if there’s other workaround for this? (ray stays same level as ship) and i’am fairly new to unity so not sure what exactly i should do…
I want the end of the ray (black cube) to always be at the same level of the ship. currently when turning, the black cube goes at a lower Position as you can see from the picture.
also need to say the ray start & end are child of the ship.
If you want to position the cube at right above the spot where the ray intersects the ground, then simply assign the y value of the ship to hit point, before assigning it to the cube.
if you made a cube, then another one as a child… then rotated main cube on X axis, the second one would go down, this is normal for Unity but i need a way for this not to happen, i think this is the problem in my case?
If you don’t want the second cube to rotate with the first, then you should simply not parent them that way. If you want the second cube to track the first one’s position but not rotation, then just add a script that, in LateUpdate(), copies the position of the thing it’s following (plus some offset) to its own position.
I did other method, a Ray from screen to MousePosition, and another Ray from the ship to the End of the first ray… i don’t know if this is efficient or not but it seems to be fine for now
now when rotating the ship, the ray coming from the ship wouldn’t go on a lower level .
Glad you found a solution. Not to hijack your thread, but can I ask how you did that cool, seemingly-infinite ground? Is it just a really big textured plane, or is there something more clever to it?