How to make a falling enemy?

I was trying to make a falling enemy similar to the ice spikes in super Mario maker. How can I make a spike that falls when the player is under it? Thx!

1 Like

One way of doing it, but there are several:
Place your spike, and add an event:
condition: the X position of player is more than (X position of spike minus 50 pixels),
action: apply a force to spike at 90° angle.

2 Likes

Or just x position. .

Got the job done awesome thx!

This works but is there a way to activate only the one spike thats above the player? I tried it with multiple spikes, and all of them fell when the player was under them.

Sure, you’ll need to put your events inside a for each event. You’ll find it in the big plus in the top right icons.

another option would be give the spike a platformer behavior, set speed to 0, and make an invisible platform under it that doesn’t apply to the player. Then: condition: object “player” is in collision with “invisible_platform” action: delete “invisible_platform”

Can you explain how to achieve this?

player is in collision with platform - disable behavior ‘platformer character’ of player.
then make it so the action inverts when the player is not in collision with the platform.

That won’t work. As I understand it, the platformer character movement, collision and separation from the platform is done before the events are processed. So the collision will never be detected.