RTS Unit problem

I want to make an RTS game. I created an object for the units, and when I click on it, the object appears on the game map, and everything works fine so far. But I want to add some controls, health bars, etc., to this object, and some errors occur because these objects are considered the same. Is there a way to make these spawned objects independent of each other?

As far as the answer to your current questions, you will need to really get a grasp of variables. At least both Scene and Object ones and maybe Global depending what all you’re wanting to do. You’re going to want to learn about the link objects actions. I would suggest watching the Tutorials on the Rougelike by HelperWesley on Youtube, they’re on his channel or the Gdevelop one. They’ll give you a good break down on how to implement all that and it will show the conditions and actions for you too while explaining what those do.

This is probably going to sound weird on the How do I forum, but you should check out Vegetato’s template project for this. He’s got a template you can purchase and use as a base for your game. I started out wanting to make an RTS(ish) style game. (Think more like Metal Fatigue and their actual mechs than a normal RTS but you also play a character moba style) I am a year into using this engine and I have literally created everything else for my game but the RTS aspect.

I recommend the template purchase because I spent so much time just searching for tutorials on it and watching so many tutorials that are near the idea, you know hoping I could piece things together. I collaborated with other people through direct messaging and forum posts and I didn’t learn nearly as much as I could have in way way way way way less of time if the RTS template had been available.

I could get things working in the project but my AI was super easy to get wonky. Obviously I have gotten better since I started but even still my latest attempt got everything working but holy crap did it run so dang slow. Even that attempt honestly took too many hours, and while I did learn some things. The template runs quick on my chrome book from a decade ago that isn’t supported anymore.

I think the template is under ten bucks through the game engine’s store. And it would honestly put your project ahead of mine as soon as you open it and change the name. Uh if you check out their itch page, you can find the template for under $5.

Without object linking

With object linking

LOOK AT IT CLOSELY!!!

This is not just for you but any1 that will try to use it

We repeat for each instance of SOME OBJECT

That SOME OBJECT is referenced as 2nd in linking condition
If it will be 1st it will NOT work

So it is take into account all HEART linked to GRASS and now it works

BUT Take into account all GRASS linked to HEART would NOT work

And that would be cause we want to do something to grass not heart
Heart is attachment here

Now you could check using for each object are they linked same as i did in event above to change pos
And in that action add change heart width to grass variable 200/Grass.MaxHP*HP

Where 200 here is default width of heart
And heart is your hp bar
Grass is your unit and max hp and hp are your unit HP vars

I couldn’t find the ‘Repeat for Each’ command at all. Is it added with an extra extension or something?

Thank you very much for your comment, but I can’t afford the 7 dollars at the moment.

Right click any event choose add and choose repeat for each instance object or something like that
NOT just repeat cause that is different event

BTW join gdevelop discord you have button for it if you scroll up to the top of your topic in upper right

And next time just ask on help channel for where is repeat for each
You could also just google it

I couldn’t fint it again

You added condition
I told you to right click event
I was looking it for almost hour 1st time i saw it on some screenshot