Baddie Falling Over?
Hello all,
I am having a couple of small problems that I am hoping a couple of you might br able to help. I have only just starting adding other non-playable characters to the project and the problem stems from that.
The first problem is that my “baddie” character keeps falling over at the start of the game. I am using the rigidbody component as the ground in the cave is really uneven and when I finally get the baddie moving I want them to stick to the ground. The second component is the capsule collider as I do not want the hero to move thru the baddie.
Now is the only way to stop my character falling over on start, to use constraints of the X-Z axis or should I be using something else? I am imaging having the constraints locked would cause a problem down the track with movement, or is this assumption wrong?
The second problem is when the player rotates to face the hero, after walking in the cave, with the constraints on and gets hit falls over again? So is there some method of stopping this as well.
And just in case my code for rotating the character is causing any problems, this is what I have been using:
Quaternion rotation = Quaternion.LookRotation(player.position - transform.position );
transform.rotation = Quaternion.Slerp(transform.rotation,rotation, Time.deltaTime * 1);
(it’s from an older project that I did 2 years ago)
To anyone who can help here is a big thankyou in advance.
Regards.