Making an FPS game and trying to make it so if you have any teammates and you look at them, their name (health is optional) appears. I used a billboard GUI.
You could use Camera:WorldToScreenPoint on all of the player’s teammates then get how far the screenpoint is from the center of the screen, then enable the billboard gui and vice versa when they go outside of view
Oh. Uh. I meant like how to make the text in the billboard say the teammates name.
Im pretty sure it’s easy to do but I can’t figure it out
I found this on another post, it should work.
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
wait(.03)
char:WaitForChild('Humanoid').NameOcclusion=Enum.NameOcclusion.EnemyOcclusion
char:WaitForChild('Humanoid').HealthDisplayDistance=999999*999999
char:WaitForChild('Humanoid').NameDisplayDistance=999999*999999
end)
end)
Everyone will be able to see each others name tag automatically, but this will do the health bar, so people can see each others health. It will let everyone see everyones health. It is the closest thing I found to making it so only people on the same team could see each others health.
By the way wait(0.001) is impossible since the minimum wait time is (0.03) .
Thanks for telling me that, I made sure to fix it.