How do I make the enemy move faster when it hits a object

how do I make the enemy move faster when it hits a object

How are you currently making the enemy move?

To make a sprite move you add a force (not entirely correct from a physics point of view but we are in the GDevelop universe). To make the sprite move faster, just increase the force.

So what you could do is to add more speed in the direction the sprite is moving anyway, like so:
Add to SPRITE a permanent force, angle SPRITE.ForceAngle() and length: SPEEDUP pixels

Find better values for SPRITE and SPEEDUP.

That’s all assuming Rashodi666 isn’t controlling movement using a behaviour, just updating the X and Y components based on key press, or some other movement control mechanism.

You have to be more specific with your question, because there are differents types of movements, like forces or with physics. If you use forces, you can simply duplicate the events that move the object and add on the duplicated events a condition like object variable “collision” of object A is 1. Then, add an event with the condition that object A is in collision with object B and the action: change the object variable “collision” of object A set to 1. In this way, the forces of the two events will be added and thus the object A will move faster.
Keep in mind that they have to be with trigger once condition.

Good point, I did not think of that.

1 Like