Quantcast
Channel: Answers for "What is the problem in my script?"
Browsing latest articles
Browse All 6 View Live

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 Article


Answer 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 Article


Answer 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
Browsing latest articles
Browse All 6 View Live