- Home /
Question by
knowlife4 · Jan 05, 2021 at 11:16 PM ·
c#raycastvector3localspace
Snapping object to raycast hit in 1 local axis.
I'm trying to lock my player to the raycast hit, but only in one "local" direction. I essentially want my player locked to the ground, while still allowing it to move left and right locally. The ground rotates.
help.png
(28.6 kB)
Comment
Best Answer
Answer by MSavioti · Jan 05, 2021 at 11:39 PM
You can get the hit.distance and move the object proportionally to this value, using the direction to the point as well.