I know this is probably something very simple I’ve just forgotten, but I’m trying to make the player able to rotate 180 degrees and stay there, but at the moment they are only rotated for as long as the key is pressed. This is what I have:
if (CrossPlatformInputManager.GetButton("Turn"))
{
transform.Rotate(Vector3.up, 180, Space.Self);
}
I wanted to make it so this happens smoothly in the space of about 1 second but I’d like to get the turning working first.
This is on the first person controller (albeit a slightly modified version, but nothing I’ve done would interfere with this) so it might be something on there that is messing it up. I’ve tried all kinds of things like different if statements, transforms and such even though the solution is probably much simpler than that. I am quite new to unity so pointers would be helpful.
Any help is appreciated