How do you make a hurt indicator and tell where the damage is coming from?

Does anyone know how to make a hurt indicator?
Like those red things that appear on your screen that tell you where your taking damage from in an fps game?

Example:
picturea

2 Likes

I haven’t tried this yet, but what I would do is this:

Connect an event that fires every time humanoid’s health is damaged
Check if the humanoid actually suffered damage (Comparing previous health to current health, up to you how)
Then get the position of the player who damaged you.
Afterwards use Camera | Roblox Creator Documentation. Get the screen point of the position.
Use a gui? Or image label? Then point it towards the screen point, somehow.

Im just giving you rough sketches on how to do it. Good luck.

I guess you can use Camera.CFrame and call :ToObjectSpace() with the shooter’s root part cframe as the parameter. Then, you call get the angle with :ToEulerAnglesXYZ() and use math.deg() on the y value. From there, you have the degrees, so you can set the rotation of a gui and do some trig to reposition it.