Hey ![]()
So I declared 2 public variables “selectedBaseTower” & “selectedTargetTower” in the gameManager, they are initially empty, when I click a game object with the tag “tower” .Then the game object (the tower) is affected in the field of “selectedBaseTower” or “selectedtargettower” (that’s working perfectly as I wanted) .
The problem is when I want to use the tower prefab position, I can’t access it by using this line of code, I get the position of the GameManager which holds the 2 variables and not the position of the prefabs in the field
Vector3 spawnPosition = new Vector3(selectedBaseTower.transform.position.x, selectedBaseTower.transform.position.y, selectedBaseTower.transform.position.z);
