(Solved) Next/Back button

I have 13 “pages” that I want to “next” and “back” using buttons. But when I go next I can’t go back to my previous page. Anyone have any ideas?

I’m not sure of what I’m doing.

Why are you using different variables for forward and backwards? Why not use a scene variable and either increase or decrease it?

What are you making? No offense but it seems chaotic. It’s probably just that I don’t know your concept.

Maybe, you can simplify it by putting all the of images in 1 object and then change the animation. Or use create object by name using a group.

1 Like

No worries, no offense taken. It is chaotic, I’m laughing at myself right now. I’m still learning Gdevelop for a project due August :frowning:

1 Like

I want to create something like this:

link: Inside Out 2 - Emotional Intelligence Presentation

I plan for my page to go next when I click “FWDBTN” (no slide animation) and go to the previous page when I click “BCKBTN” (no slide animation). But, my brain just goes…

You could set the animation based on a variable or you could layout the slides side by side on 1 layer and use buttons on another layer to move the camera of the other layer either slowly or immediately. The version depends on whether you’re just changing the image or there’s more things being changed.

I can post some events if needed. Does either version sound okay?

2 Likes

The animation one sounds good. I really appreciate your help :sob:

Sure thing. Add a scene variable named counter and set it to 0 as it’s default value.

Add a sprite named Slide, add the animations to it.
Add forward and backward buttons.

I tested this with 3 images. Since the first image is 0, I used 2 for the last frame. Change the 2 in the 2nd and 3rd event to the number of frames.

If you want to hide the buttons then you also need to disable the button bc even hidden buttons can be clicked.

1 Like

Thank you so much for helping me @Keith_1357 ! :sob:

1 Like

@Keith_1357 I don’t know what happened but mine don’t work. :frowning:


image

The 2nd event should activate both buttons. I used a button object, so I disabled/enabled the interaction but disabling/enabling the button behavior should have the same affect.

Since you’re using is pressed you probably also need a trigger once for your buttons. Otherwise, it will move backwards/forward multiple times for as long as the buttons are pressed.

This is my whole set up. I apologize if it’s a little chaotic.

What I’m trying to do is scene pause when I tap “? Mission” icon and then the Mission02, BCKBTN, and FWDBTN appears (create object) and when I tap on “Return” the scene starts and deletes all the Pause Group (includes BCKBTN etc). The Mission02 is my “slide” and is what I’m trying to next/back.

What happened now is that the BCKBTN and FWDBTN works as intended in the paused scene. But, when I Return and then press “? Mission” again, the BCKBTN and FWDBTN just doesn’t work.

I’m not too familiar with time scale but I think it needs time scale for layer not scene. Put the ui on its own layer and set the time scale of the other layers to 0. Scene scale affects the entire scene.

Embrace the chaos. You’ll get better. I don’t judge anyone.

1 Like