Im making an RTS game where you can click to buy buildings then place them but I having trouble when rotating the building. It has a canvas that displays the health of the building and when I rotate the building it rotates relative to the building too. How can I make the canvas rotate so that it basically stays in the same spot nomatter the rotation (See the picture). Thanks!!
This is what I’ve been trying:
It needs to go through these points
1 (0, 24.3, -32)
2 (32, 24.3, 0)
3 (0, 24.3, 32)
4 (-32, 24.3, 0)
Then just repeats after that… It is the fourth point that keeps messing me up because if you I cant get the third point to get to the fourth point. How can I do this?
currentBuilding.GetComponent<PlaceableBuilding> ().Bars.transform.localPosition = new Vector3 (-currentBuilding.GetComponent<PlaceableBuilding> ().Bars.transform.localPosition.x + 32, 24.3f, currentBuilding.GetComponent<PlaceableBuilding> ().Bars.transform.localPosition.z + 32);