How can I do this?

I’m trying to make a Gui health bar that follows the players camera, but the issue is SurfaceGui does not load on parts at all.

How else can I do this?

image
image

I’m a bit confused at what you mean by the SurfaceGui is not loading on parts. If you want to have the health bar follow the player’s camera, set the part’s CFrame to the camera’s CFrame with an offset. You will likely have to make the part much smaller than its current size.

1 Like

Instead of a SurfaceGui, use a ScreenGui. Insert a Frame as the background of the health bar and a ScreenGui object as the health bar’s background in StarterGui. Adjust the frames’ appearance as necessary. Reference the inner Frame and the ScreenGui in a LocalScript. Create a RenderStepped event and use the mouse position and viewport dimensions to update the health bar’s position in relation to the player’s camera. The inner Frames’ size is altered to reflect the players’ health based on that value x

1 Like