Okay, so I’m trying to make my characters spine rotate based off the rotation of the camera. I’ve had no luck so far and have done plenty of googling and managed to work around a bit, but still to no luck. First things first. I found that you can’t seem to rotate the bones of the character unless done in a late update. So I tried a basic code like so and it worked.
public Transform Spine;
void LateUpdate()
{
Spine.transform.Rotate(30, 0, 0);
}
The character looks up at a slight angle as intended. Great! Now to make it based off the camera’s rotation so the character will actually be looking up when the player does. So I made a float. Actually I started with Quaternions but had issues with it. SO I decided to make it as simple as possible. I created the float SpineX, then tried to base the rotation the exact same way but using the float instead of 30. So like so:
public Transform Spine;
public Transform CameraControlObject;
public float SpineX;
void LateUpdate()
{
Spine.transform.Rotate(SpineX, 0, 0);
}
void Update()
{
SpineX = CameraControlObject.transform.rotation.x;
}
So I thought this would work, but it doesn’t rotate him at all. And when I did something similar using Quaternions, Vector3, etc. I had similar luck where it wouldn’t rotate properly. But at least it rotated. I am gonna try and rewrite it back into my Vector3 format and play with that because at least that way it did rotate. Maybe I can correct it.