#How do i efficiently rotate an object towards a gun while having the surface normal applied

4 messages · Page 1 of 1 (latest)

haughty rose
#

Rn i got it taking the forward vector of the gun (trigger handle) with the y multiplied by 1,000 whenever the y of the surface normal from the raycaster is >= 1 or <= -1 (if surface normal is the floor or ceiling).

I know my method cant be practical 🤣 but i tried so much, idk y its this hard. I thought it would just be the forward vector of the gun, but with the y of the surface normal, but when i do that, it works but tilts the object a little upwards after setting the transform to the position of the hit position, and rotation as my 'method'.

#

Also, i dont mean like, rotating the object to face the gun, just the direction the gun is pointing in

wooden cave
#

I know how make

ashen latch
#

@haughty rose I don't think I follow, could you explain it a bit more? Are you trying to have an object rotate in the same direction as the gun but sitting on a certain plane?