when I play, my enemy moves and I want that when he appears on the screen he starts moving and also that when he hits a wall he turns to the other side
Do you have center camera event currently? Make a condition to select between centering camera to player or enemy, then when it’s supposed to center on enemy, use “Center camera on an object” action.
For your other thing you’ll need to be more specific. What kind of game are you making? Screenshots would help.
what I want is for him to just move when he is in the camera because when they appear just in the camera he is already somewhere else or they fall and I also want them to turn when they collide with a wall, the type of game I am doing is platform
Okay, topic name could’ve been clearer though.
Let’s see…
To make the enemy only move in camera,
Make an invisible sprite the same size as game screen, then check if enemy is colliding with it. If true then the enemy should move.
You can also check distance of X position between player and enemy, and set it to higher value than screen width.
To make them turn when they hit wall, assuming your box and ground is serparate object,
Make a variable to control the speed/direction of the enemy, and a condition that checks if the enemy is colliding with the box, with Trigger Once condition also. In this event invert the speed variable by multiplying it with -1.
For more info check here: Add enemies to your platformer game [GDevelop wiki]
thanks, it has helped me a lot