How to upgrade each object & Move enemies from the object

Actually I have two questions:

  1. How to change each object? (like upgrade) After I place the tower I want to upgrade only 1 and the others remain same (See screen shot) All of them changed

  1. How to move the enemies away from the object? going forward to centre point (It keeps hitting collision of the object but I need it going around)

1 - would be most likely in action where you place your tower you need add action to select that tower so game knows this is the one you want to upgrade

So you need to make system for selecting towers

2 - I think you wanna check pathfinding

Can’t be identified because doesn’t know which tower need to be upgrade. Check ss down. I’m trying to put each tower as variable (1,2,3…etc) to know each one is alone. I don’t know if I’m right or not am just trying. I took this from tut.

https://www.youtube.com/watch?v=b2eavtLhftI&t=1s

where each group of enemy walked by order.

Before that. Check ss down.

At 1:49 you have events for selecting building

Also i don’t really understand your events
If this is to place tower

Then right under create object action you can shove in something to do something to object you just created

Or are we talking about selecting objects after they are created?
Cause that is covered in the video

Yes, after placing the tower I need to upgrade like changing animation or fire with only one tower. Then when I place another tower should be reset as original (not changing)

Do you have any logic for selecting towers?

That’s what I’m looking for. After selecting tower what’s the right logic should be?

Wait i am confused
I see there only logic for placing towers

Now i understand you want to have ability to upgrade towers but do it only to tower that is selected

So tell me

A - are you looking for a way to set tower type/upgrade when placing it

or

B - a way to select tower at any point in time to show upgrade menu and upgrade selected tower?

B

Show menu to upgrade each one

I have there 4 copies of one object called Ballz which is this

When they are clicked

I do 2 things i change Ballz variable Picked to 1 same for animation
If LMB is clicked but cursor is not on any Ballz i set their variable Picked to 0 same for animation
Actually i am setting them to mod(Number I wanna mod +1 ,2)
Which more or less means take that number and circle it around 2
So it can be only 0 or 1 cause 0 also counts as number

Imagine you have timer which counts seconds it will go 1,2,3,4…100 and so go on
And you want it to circle around 60 secs
So you go with mod(Timer,60)
That is what mod() expression does

Now animation change is there only for you to have visual representation of which was clicked last
So in other words which is selected

Also you can click on same exact ballz to de select it
While if you click anywhere NOT on any ballz you will deselect them all
BUT that does not need to be
You can shove there ANY kind of events to de select ballz
For example
You can add to this sub event condition that cursor is NOT on other object
And now you could click on that object without deselecting ballz that is selected

Or add all your UI elements into a group called UI and put them in condition
This way you need to click on empty field to deselect ballz

A LOT of stuff you can do here actually to manage selecting ballz
And now as long as variable of ballz is 1 you can use condition
Ballz variable picked = 1
And do whatever in action like upgrading show some menu or whatever
Even create some indicator to instead of using animation like i did

Try it

1 Like

Thank you very much, I made new project to test after hours finally I found my mistake I put (Variable picked = 1) without identified the ballz. Later I’ll test with my game and let you know if I faced something.

1 Like