- Home /
Trying to rotate my characters upper body to face the mouses y position
This is for a side scroller game so I don't need to worry about the z-axis. Right now the character faces towards the mouses x-axis, but if I aim up or down the character doesn't do anything. I think it has to do with the animations controlling the character. But essentially what I want to do is have the characters middle spine bone face the mouse's y position. I have no idea how to go about that though. Any help would be appreciated. I am using a rigid body on my character if that matters.
Answer by Apples_mmmmmmmm · Dec 23, 2011 at 04:39 AM
You might be able to get that to work using the smoothLookAt script that is included with unity. The script is for cameras, but it may provide the effect your looking for, try attaching the script to the body, and drag the target it needs to look at into the target slot in the script.
If this doesn't work, you could animate a pose for standing, looking up, and looking down. With these poses you could write a script so that when the mouse is level with the characters height the animation = standing, when the position is above the animation = looking up, and when the position is below the animation = looking down.