↧
Answer by asafsitner
I took the liberty to copy your code and format it a bit. It appears the problem is with your flow - in the OnCollisionEnter function you first check to see if moveLeft is true, and if so set moveRight...
View ArticleAnswer by leonardo_try
well, if your problem is in the comparison, try to do this: if(moveLeft){ moveLeft = false; moveRight = true; } else { moveLeft = true; moveRight = false; }
View ArticleAnswer by msknapp
At first glance, try this: function OnCollisionEnter(Zombie : Collision) { if(Zombie.tag == "obst") { //If it collide with the obstacle if (moveLeft == true) { //If it's walking to left moveRight ==...
View Article