i can’t solve how make enemy move and stop then move can help? and i can’t find tutorial to make this
Do you mean you want your enemies to walk left, collide with the ‘Right’ object, stop for a second or two, then walk right?
If so, I recommend setting ‘walk’ to 0 when you want them to stop, and -1 when you want them to walk left. Then it’s just a matter of using timers to change ‘walk’ from 0 to 1 or -1.
i am can’t understand sorry have some tutorials?
Here’s a quick example. There’s some duplication, so it could use some optimising, but it should point you in the right direction:
thx BWPanda for helping me
You need to make sure your enemy has a default value for ‘walk’ when you start. Either set the variable in the Instance Properties Panel, or add an action to do this in the “At the beginning of the scene” event.
dam it i cant uderstand what i need to add in variable?
Dosen’t work when i start it stops and it move little bit left and stops its broken
ok where i need to put?
Well in the is X moving event you add Stop from Enemies (remove all forces)
Other thing that I do is to add a Boolean to the Enemies like isAttacking or isHurt or CanMove
Then check if bool Enemy.CanMove = true
All the events that moves the enemy are inside
If bool Enemy.CanMove = false
Enemies Stop remove forces
Enemies animaton = idle
omg sorry man i cant understand how make this complicate puzzle i tried to best but i can’t i don’t know where is x moving or were add boolean to enemies or variable game i feel bad for me i am useless can you do some tutorial?
Ok i finally fix it jess god sorry i was little bit learning but i have something problem can you tell how to fix this?
what happen?
i found only red enemy sprite will work normaly but why green enemy is glitch?
Basic checks
The box collision mask of each frame of the enemies make sure all the collisions are the same size.
Stop the enemy when he first collides to Left or right then flip then move again
ok its works you right its box collisions