#Canons stop working when there are more than one

1 messages · Page 1 of 1 (latest)

glacial cairn
#

my logic lets you drag and place canons on different grid squares and merge when 2 of the same kind are close when you let go of dragging, however after i spawn the second prefab of the canon, they drag fine but both lose the ability to snap to a new square but they can still merge, but also cant snap to new cells after merging. ive looked through all the code, there is no logic that says after there are 2 cannons, that anything should stop working. It spawns enemies after 2 but i tried with that commented out as well. The canon limit was 2 and i checked without the limit and it still does the same thing, stops snapping after 2.

https://paste.myst.rs/tm4uz6uq

runic plaza
#

!code

deep patrolBOT
glacial cairn
#

(lowkey urgent) Canons stop working when there are more than one

lethal quarry
#

A lot of misterious code there.
For example, this seems to be what should snap the cannons, but it actually snaps the object with the drag script..?

gameObject.GetComponent<Transform>().position = gameObject.GetComponent<CanonController>().GetCurrrentCellPosition();
#

Though it seems like the cannon is on the same object as well..?

#

In this case the dragging logic is gonna run on all your cannons at the same time, no?

glacial cairn
#

Canons stop working when there are more than one

glacial cairn
glacial cairn
#

(Returned Bug) Canons stop working when there are more than one

#

it came back guys

#

idek how

#

updating the link to the newer code

glacial cairn
#

ok i figured out WHERE the issue is

#

the issue starts whenever I uncomment the coin spending line

#

but i cant figure out why

glacial cairn
#

I think it just cant find the coin system 😭✋️

#

all that drama and for what