(SOLVED) Elevator remain stopped

Hi, i have a problem with elevator.
The first time that i press PageUp, the elevator moves. But after the first time, the elevator remain stopped. Even though i press PageDown or again PageUp, the elevator doesn’t move again.
Please, where is the error ?

Thank you!!!

Did you try using Trigger Once conditions after the key presses?

yes @Gorguruga , but it doesn’t the right solution

After you press up to move the elevator up, is it still in collision with Dotter? Maybe your hitbox for the elevator is no longer in collision with the character when it moves up? If so, you can either try to make the hitbox longer so that when it goes up, it’s still in collision with Dottor. Or you can use a different thing to trigger the elevator (like a button that doesn’t move)

Also this one here

It means if the PageDown key AND the PageUP are not pressed TOGETHER then Stop all forces.

You could try to make them separate events, or you can use Advanced condtion … select the “Or Advanced”>

Then it will give you this >
And you put the “PageUp / PageDown not pressed” conditions in there… I don’t know if that has anything to do with the problem but just mentioning it in case

@Gorguruga thanks! but i don’t understand :frowning:

I semplified the event , but the problem worse

Now, the elevator doens’t move neither one time.
Elevator is on the first floor and collide with floor_elevator at the beginning. Eventhough press PageUp, the elevator doesn’t move.

Try to use Trigger once… On the conditions.

Can you share a screenshot of the scene of your game?

I wonder if your events are conflicting with each other. You have an event for PageDown key is pressed, and another condition when PageDown key is pressed “inverted”.

If the elevator is in collision with floor elevator, whether you press PageDown or PageUp, the opposite key will read as not pressed, making the one of the inverted conditions read true and stopping all forces.

Maybe you can add an “inverted elevator in collision with floor_elevator” condition and nest your first pageup/pagedown beneath it. Or try putting the stop elevator events above the move elevator events.

I find a partial solution.
The elevator move if i take off the condition : “Doctor is in collision with elevator”

if i put the condition : “Doctor is in collision with elevator”, the elevator doesnt move again!

@Gorguruga , @fitkoh , @Midhil thanks, but it doens’t run.

Maybe i understand the problem, but i don’t find a solution.

At the beginning the Doctor is in on the elevator, and GD detect the collision.
So, the elevator change floor when i press PageUp/PageDown (but only for the first time)

After the first movement of the elevator, GD doesn’t detect again the collision of Doctor with it, even though the Doctor doesn’t changed the position on the elevator.

For the entire session of the game, GD doesn’t detect the collision between Doctor and the elevator after it changed floor. I move the Doctor out of the elevator, and than come back on it, but nothing… for GD isn’t on the elevator…so it doesn’t caught the event of PageDown/PageUp again.
Why ?

this is the map of scene. (the green line is the “floor_elevator”)

I will be messing around with your elevator problem in gdevelop and I will try to find a solution for it🧐 and tell you ASAP

1 Like

I think it might be connected to the Trigger Once command. If you don’t use that it might be telling GD to permanently Stop All Forces, so it might not work after first time. You could try to put the Stop All Forces as a sub-event of the key press and use Trigger Once on that so that every time you press key it’s retriggered, but when you let go it should stop being triggered.

Just guessing there. If that doesn’t work and the game is small file size (and you don’t mind sharing the project folder), you could zip it and upload… we’ll take a look.

1 Like

One question, Do you want the elevator to only move when the page up/down key is pressed or to move to the top when page up is pressed and vice versa

@Gorguruga i ve also this event :


So, Doctor doesn’t jump when collide with the elevator, but it can jump only when go down from the elevator.
At the beginning Doctor doesn’t jump on the elevator, but after it changed the floor (for the first time), GD doesn’t detect the collision, and Doctor can jump also on the elevator…
i can’t understand why GD stop to detect the collision…

When the doctor is on the elevator, and i press PageUp, the elevator move on the next floor (without keep pressing PageUp) The elevator will stop when it collide with floor_elevator.
This is that i’d like to do…
Thank you very much!

This should work

The code:

The behavior for the elevator:


You need to use the tween behavior because it is simple and easy

1 Like

Midhil has a detailed solution which should solve it.

With the tween behavior you can get a “bouncy” elevator effect if you experiment with the different tween types or you can keep it “linear”. It’s a style choice, whatever effect you prefer. But tween is very cool :slight_smile:

1 Like

thank you! @Midhil and @Gorguruga
Only one last thing : but if i have many floors… and different elevator ?
Do I create elevator1, TopFLoorCheck1, secondFloorCheck1…etc…
than… elevator2, TopFloorCheck2, secondoFloorCheck2 …etc… ?
Is this right ?

This should work as long as your elevators are not super close to ech other.