Tryng to do a levitation effect

First of all, my engish is pretty bad so if you don’t understand anything I’ll try to explain that better.
I want to make a button that when gets pressed by the player will make the player levitate. This is my “code”:


However, it doesn’t work unless I manually press the “jump” button.
Why this happens?

Just a guess but I think it might have something to do with your condition being a collision. In your events, you move the player on the Y axis so it may no longer be in collision. Maybe you can use the collision to set a variable that will control the events rather having them controlled by collision? Or possibly try moving the jump actions so they’re above the add force events in the editor

1 Like

“Trigger Once” is not a condition that can be used by itself. Your sub-condition of “Trigger Once” is never true, therefore the actions don’t happen. Move the “Trigger Once” up underneath the collision, and all of the actions into the same box. It should look something like this:

2 Likes