[SOLVED]Help needed with instance related problems



I’m trying to make it so the tween (occurs in the occur once part of the function) and the jitter and size parts (occur in the external events as sub events) as well as the explosion spawning occur separately for each button, but currently the jitter and size parts don’t occur at all when there are 2 or more buttons at once, the tween only occurs for whatever button was created last, and only the first button can be clicked. Also, the explosion only spawns on the clickable button and the other button’s button and hitbox parts don’t disappear like they should, only the text does. If there is only one button instance then everything works completely fine.

Example if the paragraph above is confusing:
Button ID 1 exists:
Perfectly fine
Button ID 2 is created and then 3 is:
Only 3 will do the initial tween, neither will sense the mouse above them to do the visual effects, only 2 is clickable and only 2 will have the explosion

Imo, you’re doing things the hard way. If you don’t want to customize a button object, that fine. It’s all your choice. I don’t know why the buttons need hitboxes. Why can’t you just use the button?

There are also a bunch of button behaviors that simplify things.

Instances are usually more efficient but for simple buttons, it might be clearer to use seperate objects named like StartButton or LeftButton.

It would just be more direct and straightforward.

You could still put the buttons into a group but then use the actual button object for the conditions and actions.

the hitbox is for a bug that was eventually fixed, but I’ve decided to keep it so that the hitbox of the button stays consistent even with the effects. I also want to keep my existing system unless I absolutely have to change to a button object like you suggested

1 Like

I might decide to use some of those button behaviors to simplify my buttons, but I like doing the buttons my way as an object, text, and hitbox that are all linked.

If I can’t solve the problem, which behaviors should I use to mimic the current effects?

See my previous post. There’s one that adds states and one that handles the tween.

I don’t want to make each button a separate object, even if I can just group them all together to be cleaner, as with my plans, there will be well over 100 unique buttons. I like the idea of using the same 3 objects for all of them.

The button states behavior simplified the system I’m using, but I’ve solved a few problems while creating another.



these are the events now, both buttons will resize when hovered now but their texts don’t and the tween still only occurs on the newer button. Also the button object on other buttons doesn’t disappear when one is clicked.

I’m honestly not sure where to start here… lol.

By the way, just a quick reminder: the “wait x seconds” action is not synchronous. This means that while it’s waiting, other things in the scene continue to run — so it behaves quite differently from a classic timer action. Just keep that in mind.

In my opinion, the issue lies in the “take into account” events. I think some of them are missing, and there are also a few missing “trigger once” conditions. But I haven’t been able to dig deeper into it yet.

1 Like

I added a take into account on the bottom part, which is when the mouse is taken off and it fixed the text problem. The only problems left now are the tween only occuring on the newest button, the global button destruction not working when one is clicked, and the explosion only spawning on one button.



These are the event sheets now, the ONLY problems left are the buttons not tweening individually and the other button instances not getting deleted by delete buttons. The problem seems to be an issue with picking the right instance.

i guess you should add a “take into account” at the repeat for each, removing the rests and organize the whole events

I moved the tween logic from the function to the external events and now each one tweens separately like they should, and I added a take into account on the button deletion, but now the other text doesn’t disappear. Despite deleting fewer objects, this seems to be a step in the right direction. What’s left to make sure ALL instances of buttons and button text disappear?

if u are sure that everything working rite as your last resort do:
pick all buttons---->delete button text

IT FINALLY WORKS!!!

I made a few inefficient ways to get it to work but it finally does

I’ve spent 12 hours on this and can finally make the game

1 Like

Hi @TWillyH!

Like what, you always have to persevere.
It’s the key of success.

A+
Xierra

1 Like