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
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.
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.
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.