- Home /
Replicate cow behaviour from Serious Sam
Hi !
For exercice purpose, i am trying to replicate the behaviour of the cow from Serious Sam.
For those who don't know this marvelous cow : https://www.youtube.com/watch?v=EL9Ik2GkZsw The cow is an enemy that charge in your direction, got very little turning capacity (allowing player to escape by straffing). Either it missing you or hit you, the cow continue it's path, taking a long time to brake, long time to turn, and then charge you again. Indefinitly.
For now, i have set up and object with a rigidbody / collider / Nav Mesh Agent / Third Person Character ( sample script from unity asset if i am right).
The script is pretty simple :
agent.SetDestination(player.transform.position);
if (agent.remainingDistance > agent.stoppingDistance)
{
character.Move(agent.desiredVelocity, false, false);
}
else
{
character.Move(Vector3.zero, false, false);
}
The object go to the position of the player.
And here i am lost. i don't know how to set up this low turning point. I have tried to play with Angular speed (from navmesh agent), even at 0, it does not change a thing.
Do you guyz have any general direction that i can look at please ? My next try will be to script this behaviour (as i haveen't found a way to replicate this by using nav Mesh agent or rigidbody property, or am i missing something ? ) My best guess is to calculate a fictionnal Destination for the object that won't make the object turn more than a certain degree.