Hi, I’m having issues with my stabilization script. The thing I want to make is that the Y axis of the head is moving left and right, thus moving the Y axis of the camera, and I want to remove that movement in the camera.
I cannot remove the camera from the head as it is needed for movement, but want to reduce the “jitter”, so I need to calculate for example:
If the head moves +3 in y (The Head Part) to reduce -3 in y (Camera), but that the Camera Y is still effected by the Player’s Y, if he moves his body for +30 in Y.
One moment while I search for the face palm emoticon.
Step 1. Stop using UnityScript.
The video is more the theory than the actual code. Euler angles allow you to use vector3s…Instead of handling the rotation using Quaternion, you can use the LocalEulerAngle which basically is a vector3 convert function which allows you to specify rotation values.
If you wanted to change the rotation on the y, you could simple say:
transform.localeulerangles.y = blah. (if you’re using javascript I think this is legal…Not really sure.)