I’m having trouble with the BuyTower() function in my tower defense game. The currentTurretPosition shows the correct Vector3 value, but when I call the BuyTower method and print the position value using Debug.Log, it shows the vector (0,0,0) instead of the expected value.
you have added your method on start event, “currentTurretPosition” is a value type it will make a copy of the value you passing in that start frame, it’s mean your currentTurretPosition wont get update on other frame.
what you can do is, create a new class call “TurrentData” with “currentTurretPosition” in it. and then you can pass that in as reference type.