Hello, I want to create a function that when the player comes to the area with the airflow, the fan below gives him a force upwards. That works sometimes, but the player should be given a power that he can go back down as soon as he leaves the airflow area. I’ve already put something together but it doesn’t quite work, if the player leaves the area he still floats up and I can’t use the down button to go down anymore.
if your player has Platformer do when player collision with Fan_Airflow change Gravity 500 and maxfall speed 200
Then if player X in collision with Fan_Airflow set gravity to your current mine is 1000 and maxfall speed to 700
You have placed the event with the condition “player not in collision with fan_airflow” subordinated to a single “Trigger Once” condition. That means it will run only one single time in the entire game and then stop running this event forever.
You need to remove it from that lone “Trigger Once” condition.
Unfortunately, that won’t do it, otherwise the second event is only checked when the first is valid. And a Player cannot be in collision with Fan_AirFlow and not in collision with a Fan_AirFlow at the same time - unless there are more than one Fan_AitrFlow, but that will cause problems itself.
You’re best to move the second condition left so it’s in line with the first one.
However, you’ll encounter problems if you have more than one Fan_AirFlow object in the scene. The second event will then always be true, because there will be a fan the Player is not in colliding with.
Here’s one way to get around this :