#Health bug

1 messages · Page 1 of 1 (latest)

neat vapor
#

So when you lose health, the bar bugs out of the background lmao is that scripting error or smth idk honestly it's js funny and frustrating at the same time

#

I'm sorry if i did something wrong in questioning it's my first time

night ravine
neat vapor
night ravine
#

Show me a screenshot of health

#

of ur studio explorer sidebar @neat vapor

neat vapor
#

He's lazy ahh I'm trying to help them

#

Can you actually teach the dev how can we fix it?

tender iris
#

34

dense nacelle
# neat vapor Can you actually teach the dev how can we fix it?

The GUI has most likely been incorrectly configured. Health bar scripts calculate the player's health in terms of a percentage to their max health. This is used as a X fill percentage for the bar. Fill percentage (aka. "Scale") works by occupying the parent container's dimensions. If there is no parent container, then the screen dimensions are used

#

Make sure the dimensions of your health bar are defined by a Frame, and the bar itself is a child of that Frame

neat vapor
jovial badgerBOT
#

studio** You are now Level 2! **studio

neat vapor
#

And will let you know

neat vapor
#

Thankyou so much man

#

Appreciate it

neat vapor
neat vapor
#

Sending a video

tender iris
#

67

neat vapor
dense nacelle
neat vapor
# dense nacelle I thought you had fixed it?

So basically I'm animator and this is the issue faced by dev and when i told the exact thing you told me the dev said say him thanks i think it will fix it etc etc so i said thanks and it worked but it didn't when they actually tried

dense nacelle
#

I'll whip up an example for you

neat vapor
neat vapor
neat vapor
zinc ivy
#

Yeah

zinc ivy
#

@dense nacelle do you think you can help fix the bug manually?

dense nacelle
#

I can hop in a call with y'all

zinc ivy
#

I cant call at the moment, but I can add you on roblox and discord and we can discuss from there

dense nacelle
zinc ivy
#

Why cant you do that? Is there a problem?

dense nacelle
zinc ivy
#

very well then.

jovial badgerBOT
#

studio** You are now Level 1! **studio

zinc ivy
#

I can explain to you the problem, but not on call at the moment

dense nacelle
#

I am free to chat now; you do not need to use a mic yourself

zinc ivy
#

The problem me and my team are facing is that the bars keep bug9ng out of the background as you saw in the video

dense nacelle
#

Seems like a simple configuration and/or scripting problem. All I need to see is a stream

zinc ivy
#

Hm?

dense nacelle
zinc ivy
#

What are you trying to say

dense nacelle
zinc ivy
#

The bar keeps bugging out of tmitd background. Is there any solution to that?

dense nacelle
#

I need you to share your screen with me so I can get a look

zinc ivy
#

Ahh okay

#

I can get one of my devs to do that

#

Or do you think I can just record the script and the Ui?

dense nacelle
#

I may need to see things you will have missed on the recording

#

It's best we do this live. I will instruct the repairs over that call

zinc ivy
#

I dont have the time to call, im busy at the moment. Let me get one of my devs to get on call with you, or they can send a video with the scripts and Ui

dense nacelle
#

Ping them here, and we'll go from there

zinc ivy
#

Ill see what I can do, if it doesnt work out with you I'll ask Rip_Return

#

@fleet charm

jovial badgerBOT
#

studio** You are now Level 2! **studio

zinc ivy
#

Here

dense nacelle
zinc ivy
#

He will get it call w u in abt an hour

dense nacelle
#

Ok

#

Is there nobody who's free?

#

This issue should take no more than 5 minutes to fix

zinc ivy
#

He will be free in abt an hour

fleet charm
zinc ivy
#

Id love to get on call and screenshare but my camera isnt that god

zinc ivy
dense nacelle
#

Camera?

zinc ivy
dense nacelle
#

@fleet charm

zinc ivy
#

Ay thanks for the help man, I really appreciate it

fleet charm
#

Ye sure

zinc ivy
#

@dense nacelle when the game release i'd love to give you some exclusive items if thats okay with you

dense nacelle
#

Thanks though

zinc ivy
#

No problem man

dense nacelle
#

@fleet charm, an hour from now then?

#

Let me know

#

I have a call I need to take soon

fleet charm
#

Ye I’ll ping

dense nacelle
fleet charm
dense nacelle
dense nacelle
#

@zinc ivy?

zinc ivy
#

Hey i was waiting for you to get online

#

Timezones are different

dense nacelle
#

Are you able to chat now?

zinc ivy
#

Your 1 hour ahead?

zinc ivy
dense nacelle
#

Lol

dense nacelle
zinc ivy
#

Ohh okay haha

zinc ivy
zinc ivy
#

One moment

zinc ivy
night ravine
zinc ivy
#

@dense nacelle

zinc ivy
dense nacelle
zinc ivy
#

Im literally abt to go somewhere

night ravine
zinc ivy
#

@dense nacelle u on?

dense nacelle
dense nacelle
#

Are 'ya with me, @zinc ivy?

#

@fleet charm?

fleet charm
jovial badgerBOT
#

studio** You are now Level 1! **studio

fleet charm
#

I’m ready

dense nacelle
#

Hop on

fleet charm
dense nacelle
#

@fleet charm

dense nacelle
#

@zinc ivy, we've solved the problem. Here's what you need to know

  1. Your graphics designer did not configure their images correctly. The image should always conform to the dimensions of the container (aka. ImageLabel). You currently have to upscale a square to get a rectangular image to render in its center. That disturbs the natural ability to create fills that work based on scale. To fix this, you must now use UIGradient trickery.

  2. Your code was massively overengineered and poorly written. I simplified its design greatly, taking into account the relevant configuration factors, such as ResetOnSpawn and character accessibility

local Players = game:GetService("Players")


local Player = Players.LocalPlayer

local HealthBar      = script.Parent
local HealthGradient = HealthBar:WaitForChild("UIGradient") 



local function onHealthChanged(humanoid: Humanoid)
    HealthGradient.Offset = Vector2.new(humanoid.Health / humanoid.MaxHealth, 0)
end

local function onCharacterAdded(character: Model)
    local humanoid = character:FindFirstChildOfClass("Humanoid") :: Humanoid
    
    humanoid.HealthChanged:Connect(function()
        onHealthChanged(humanoid)
    end)
end



local character = Player.Character
if character then
    onCharacterAdded(character)
else
    Player.CharacterAdded:Once(onCharacterAdded)
end
#

You do not need to develop a separate mobile and PC implementation for your GUIs. Focus on ensuring the GUIs scale naturally with screen resolution

fleet charm
#

@zinc ivy

zinc ivy
jovial badgerBOT
#

studio** You are now Level 3! **studio