[SOLVED!] Saving clicks in a queue to execute events on objects when prior clicked objects are finished with theirs

Alright y’all I think I need help thinking logically about this.

If I tap an object that has a half second timer to complete the actions, but meanwhile I tap other instances of the same object, they will also do the half second timer before executing. So I can have 10 objects each running a half second timer simultaneously to complete their action about the same time if I tap really fast.

I can just set conditions so that none of the other objects will start their timer if one is already going. But I think then I only know how to do it that would just make you have to tap the new object again once the timer on the other object is finished.

But what I really want is, if you click each object, the first one you click will begin the timer, and execute the action. Then the next one you clicked and so on. Even though by now you are done clicking and you’re just waiting for them to do the timer/action thing.

Any ideas?

I think we need more info. What do the objects represent? What do the timers do? Not knowing anything, can you use tween instead or a Boolean to track the status?

Using a Boolean in connection with the “Number of instances currently picked” condition, you can count how many are in each state.

You can do that with object timers.

TimerBar - Made with Clipchamp

Ok thanks both of you. I got the object timers going. Everything else you told me to do might have went over my head Keith.

So you can see in the gif that both timers can run at the same time. That’s workable. It’s not a total loss. But what I’m trying to do is if I click both objects fast like that, the second one clicked will wait until the first one is done with the timer animation and w/e else events I add before it begins its timer/etc.

Any more clues?

Also there will be more than 2 objects I just threw this together fast for an example.
Also in the example I did change the time to 1 second instead of half a second so it would be easier to see.

I’m not sure what I’m looking at. Are the progress bars separate sprites or animations of the boxes? A screen grab of your current events might help.

Edit: I just don’t have enough to go by. Are they timers or animations?

There are 2 progress bars. Both are separate sprites from the asset store. Both are created when the object timer is triggered and the red one is set to fill up at the rate of the timer. The stationary one is just a decorative holder. Really don’t know why I added it since they’re just temp until I get mine made lol but I don’t like incompleteness.

I should add when I say set to fill up at the rate of the timer I meant, the width is scaled.
Also I should add they are deleted when the timer ends.

Is this a case that I’m going to have to figure out the advanced variables? Would I be able to add the list of each clicked object to one of the listing variables, and then tell it to go down its list and execute it for each one? Or is that possible.

That helps. I don’t have an answer right now. Let me think. Maybe someone else will have a quicker answer.

It’s alright man I always appreciate your help and it’s not like I have a deadline lol.

This was a fun challenge. I’ve never done anything exactly like this before. I think a size tween would be easier than timers but I went with the timer idea.

I didn’t know how to explain it. So, I uploaded my project. The concept is each object has an ID. When an object is clicked, if it hasn’t already been selected then the ID is appended to an array as a sort of queue or buffer. If the timerExists Boolean is false then set ID to the lowest array element, then delete it. And then use other variables to handle the rest. I can’t explain that part.

Just click a face to select it. The counter is only used to show the click order. The IDs themselves remain the same.

playable:

Source:
doug13579/adding-objects-to-a-queue (github.com)

Edit: there’s probably a simpler way but this kept the sequence.

2 Likes

Wow buddy are you serious?? You did it already?! I’m still on google trying to figure it out lmao. I played it and it looks like exactly perfect. I’m getting a 404 on the link but I’ll try later. Thanks a lot!

Editing to add, playing it more it is exactly perfect, it even lets me click ones that have been through the timer already and it always remembers the order. You are a genius.

1 Like

Sorry about that. It looks like I set it to private. Give me a minute or so to change it. I’ll update this post.

Edit: Ok, try it again.

Got it tyvm, now going to see if I can figure out what you’ve done haha.

Ok @Keith_1357 I am actually able to follow along with what you did, and it’s super smart. I can’t thank you enough, I would not have come up with this on my own, tyty <3 This should be in examples.

1 Like