#Bug with placing towers
1 messages Β· Page 1 of 1 (latest)
I am not sure, but you should use Find gameobj by component
checking 1min
Just want to confirm. If you don't spam it works properly or you still have an issue then?
If it does work when you don't spam then destroy might be the issue try replacing it with DestroyImmediate
But that did nothing
<@&823670121133768714> Anyone?
No clue, try restarting unity or your computer
Are you sure it's a unity issue and not a script error?
Sorry if you don't mind could you rephrase the question
@stuck fractal then don't spam π π
Jk
But
I don't really understand why it wouldn't work
I didn't look at your cs
Sorry i just really need to get it fixed
Umm, I'm on mobile rn, but I can check your code tmrw
okay thanks
Already did that
Idk
I fixed it!
It had to do with the OnTriggerEnter2D so i changed it to OnTriggerStay2D
First off never use find
This is a fix sure but you shouldn't rely on these kinds of things, honestly if you're going for this kind of approach just use a bounding box, that being said I can't see your scripts so I have no idea what the original issue is
OnTriggerStay is only called every fixed update so it's not really great for a lot of logic, there's also edge cases where it can get called twice or worse, not get called while you're in the collider