[SOLVED] Multiple object instances not showing


tell me what the problem is, copies are created but at one point

Please don’t add to such an old post, especially 2 years later. Instead start a new one with your question.

edit - moved new posts to this new thread

To answer your question, you have a trigger once. Once that event has been run, it won’t run again until the scene is reloaded. Remove it.

I thought the same and while I agree the trigger should be removed. I think it’s the very last line i think it’s meant to have the info follow the bot objects but it’s moving them all to the same position.
.
I’m not at my PC and I can’t really explain it. I would recommend either linking the objects or stick them together with the sticker behavior. I favor the linking.

Nice catch, I didn’t read that far :smiley:

1 Like

I thought the same but I tested the for each and it still worked. I know using a trigger once inside it doesn’t work as expected but I never figured out why. I just know that you shouldn’t do it.

I’ll keep that in mind for the future

that’s right


they are created, but why are they attached to one? before that, the objects are working normally

@yorik, @Keith_1357, I’ve moved the thread to this new topic.

They’re not “attached” per se but when you read the x,y of the bot object location Gdevelop doesn’t know which object you are referencing. So, I believe it returns the values of the instance that was created first and all the objects are moved to that location.

You can use the sticker behavior. You add it to the object that you want to stick something to and then when you create the object you stick it to the target object. That’s it. It’s now stuck. You can unstick it or check what it’s stuck to.

It’s a community behavior. You need to add it to your project and then assign to your object.

A better way, IMHO, would be to create a link. Here’s an old example of linking in case this is new to you.

These are the events related to linking.

Try it.

Project:
doug13579/Link-Object-Example: Gdevelop Link object example (github.com)

thank you, I’ll keep it in mind for the future

well, if that’s the only way… it will only have to be this way.

I looked at your example, maybe by playing with the timer you can achieve the desired result.

There are so many different ways to achieve things. My way might not be the best way but it’s the best way that I’m aware of.

2 Likes

In GDevelop, linking two objects is the best way for abstract connections, which I think is the case here. For a ‘physical’ connection use the sticker extension, so that the two objects appear connected on screen such that if one moves the other moves and stays in the same relative position to the main object.

2 Likes

Thanks for the explanation and reasoning. Perhaps my approach is not quite logical to think like this-as I am still learning.
We will try all the options !


most likely, I got confused myself somewhere (I did it from a template)
according to this logic, everything worked for me.

You don’t need that very first inverted tanktext link to tank condition. It does nothing that affects the tank selection. When you create a tanktext, any actions after that and within the same event will only be for that newly created tanktext.

1 Like