moving an enemy

i see on several tutorials there are different ways to move an enemy. this is the set up on the gdevelop wiki page for moving enemies:

however, in the platform that comes with the software the example shows a totally different way (as do most youtube videos). the events, conditions and actions for the platform example way of moving enemies seems to be longer and more complex using variables. is there a big difference or advantage to using one way over the other?

also in the tutorial on the wiki page i’m not able to get it to work? i’ve double checked everything but there is one section the tutorial that i dont understand, it says

haha, i dont already know this, how would i add this check collision condition and is this the reason my enemy object does not move? is this collision condition pictured in the above image or something else i need to add in?

thanks in advance!

I guess what it meant is that you should already know how to add an event and how to browse and add conditions to the event at that point of the tutorial. Basically the person who wrote the tutorial was too lazy to explain it step by step and to add screenshots. It was easier to say “you should know this by now”. I have no idea who that person was :smiling_imp:
Basically you need to do the same when you checked collision between the coins and the player except you need to check collision this time between the enemy and the left right object. Essentially the same staff like before only with different objects.

As you can see on the screenshot the idea is, if enemy collide with left object set direction to move right when colliding with the one on the right, set direction to move left.

Yes. If you are using variables it is allow you to move objects more dynamically on their own terms without need to populate the level with a bunch of useless objects to check collision with. Collision checking can be also heavy on resources so the less collision checking you do is the better for performance.

ddabrahim thanks for your help! i finally figured it out. i had all the conditions and actions under one event. once i moved each condition / action to their own event it worked fine.

thanks for the info on variables. i was under the impression both options used collision checks with two objects (right and left for example). is there a way to get an enemy to move without using collision check objects (what terms do i use to find tutorials on moving enemies without collision checks)? aside from AI enemies i’ve only seen collision checking enemy movements (on all tutorials and videos) or did you mean AI enemies?

thanks again!