Hi, i’m developing a game that is a sphere world map. My problem is that when I try to center player’s lifebar, the canvas is not centering the lifebar relative to player position.
I’m using this code (from X-Bars Assets) but, i dont know why, lifebar is setting to extremelly left bottom.
HealthbarPrefab.transform.position = cam.ScreenToViewportPoint(new Vector3(thisT.position.x, thisT.position.y + yOffset, thisT.position.z));
Can someone help me with this?
Just ’ more information, my canvas is render mode = screen space - overlay and canvas scaler is scale with screen size 800 x 600