I’m trying to make a simple First Person Camera Controlelr for use with the standard Xbox 360 controller.
I couldn’t find a way to equal the GameObject’s rotation to a particular value without using a Vector3. As it wouldn’t allow me to do this:
if (gameObject.transform.rotation.z > 0f)
{
gameObject.transform.rotation.z == 0f;
}
Attempting to use a new Vector3 to hold my desired values has also been futile:
if (gameObject.transform.rotation.z > 0f) //Z-axis rotation limit.
{
gameObject.transform.rotation.z = new Vector3(fControllerZLimit,fControllerZLimit,fControllerZLimit);
}
gameObject.transform.Rotate
won’t work for this as I need the Camera’s Z axis to always equal 0 so it stays upright.
Rotation is a pain T-T