You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to make a custom healthbar for zombies in my game, and i tough of using the highlight instance with changing colors in order to achieve that.
What is the issue? Include screenshots / videos if possible!
The thing is, whenever i changed the color of a zombie’s highlight for some reason even the other unaffected zombie’s color would change instead as shown below.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked around a bit but didn’t find anything, so i figured to look here.
This is the current code i use:
local zombie = script.Parent.Parent
local highlight = zombie.Highlight --i even set the adornee as the group for the zombie character.
humanoid.HealthChanged:Connect(function()
local hppercent = humanoid.Health/humanoid.MaxHealth
highlight.OutlineColor = Color3.fromHSV(hppercent * 0.3, 1, 1)
end)
I am guessing the issue might be because the highlight instance isn’t fully released or completed, please correct me if i’m wrong!
I’m very confident that’s not the issue, when i try a single zombie the script works fine, the problem emerges when there’s more than one zombie, somehow the game thinks that their highlight areas are related while they’re actually not
Do the highlights always appear?
Also, seeing script.parent.parent I assume the script is inside of the zombie?
You could maybe run this on one script and have a folder for the zombies, the using i, v in pairs to highlight all the zombies in that folder
I dont have it on hand at this moment, but the script is inside a folder inside the zombie (therefore script.Parent.Parent is the zombie), and this script is inside every one of them. Therefore other zombies shouldnt be affected like this since i never get out of the zombie, as i said, this is most likely because the feature might have not been fully released.
Maybe I’m a little late but. I had the same issue, in my case the highlight of the dummies was already in the model. What I mean by this is that I had previously manually placed the highlight in the dummy, I for some reason decided to create a new highlight with Instance.new() and this error didn’t repeat.
So basilically, using pre-existing highlights didn’t work, but ones created with Instance.new() did?
If so then that kinda makes sense since when i stopped playing the highlights’ color changed without my control
Thought I was the one with the same problem, highlights are kinda weird if you use a pre-existing one. Sometimes they don’t change color, or they do when you don’t want to or even they don’t show at all.