- Home /
Question by
etranger69 · Sep 04, 2014 at 06:08 PM ·
playerdodge
Dodge - cool down
Hi, I have made a script of player movement. I just need to make my player dodge the enemy i hit wsad+space and he dodge in the direction of the button. I just need to cool down the player. Now its looks like a teleportation. Any idea?
if(Input.GetAxis("Vertical") > 0 && Input.GetButtonDown("Strafe"))
{
rigidbody.AddForce (Camera.main.transform.forward * 7500);
}
Comment
Adding a gamey coolDown effect is a very common Q. Just look up "Unity Time delay" or some such. One popular way is to use a "can't do it again until this time" variable. But lots of Q's and lots of answers.
I need to make him make it slower not cool down how many times he can dodge. I want to look it more natural not like teleportation.