Need help with a buy system in td game!

Instead, you should make the spawner object have an animation that matches the sprite it’s about to spawn, that way you don’t have to attach anything.

1 Like

JR_01 shop example

1 Like

I mean that won’t really work, but ok :upside_down_face:

1 Like

image

3 Likes


I need help so im using object value to keep my money value but i need a way to check if i have enough money to place the tower and if i dont then i cant place but i dont know how to

2 Likes

you should use a global variable to hold the money value, so then when you click on a buy object you can access it

2 Likes

im guessing i need to use a switch but i don’t know what to do with it i don’t have very much experience with that behavior

when i tried to use the global value it messed with the money weirdly but ill try again

ok its working better now with the global value but i need a way for the money to stop the placement from placing a tower if you don’t have the money


Right here with these filters, they will activate for all of the placement objects. You need to set just one filter and one switch for each object.

1 Like

is that my stuff or yours
???

yours, it is in the “PLACMENT” object

1 Like

i meant the coding did i do that or id you tweak it?

oh wait a minute why would i only need one filter cuz there is three different towers?


i think this works but its a bit weird test it and try to fix it if any of you can

1 Like

so i put greater than or equal too but for instance i have $1000 dollars and so i buy 2 wb towers and that=$1000 but i cant buy the second one even tho i have $500 so i need to destroy one more enemy to buy it?

1 Like

In that case, just make the filter “greater than 499”

1 Like

hmm makes sense

1 Like

for some reason it still doesn’t work?

1 Like