Creating a "sound indicator" sort of marker

I want to be able to create a sort of “sound indicator” such as those seen in Arsenal and Fortnite.

I am unaware of how I would accomplish this. I’ve thought it through and can’t really figure out a key idea to even start with.

I’ve tried searching this up, but no results in what I actually want appear. I could be missing something, so even if it’s as simple as a link, any help would be appreciated!

image

what do you mean by sound indicator, like low ammo or when the gun hits somebody?

The red marker as seen in the post above; The gunfire is fired from a different user and the red marker appears.

Do you mean those indicators when you get damaged and the arrow points to where you got damaged from?

Like that, but when someone fires a gun.

I would save the health data in run service with a variable, something like this:

rs.Heartbeat:Connect(function()
Health = playerHumanoid.Health
If Health < 100 then
Script.parent.hurtgui.Visible = true --change this to whatever you want,
end
end)

I think what I was trying to convey may have been misunderstood D:

What I meant is, how would I get the position of the player and turn that into a 2d position for the gui to be located, while maintaining a circular position?

If this doesn’t make sense just let me know btw

TargetPosition - Vector3 position of the target;
This should be done in a RunService RenderStepped signal, then after a few seconds you can disconnect the signal with Signal:Disconnect(), make sure you store the signal on a variable.

	local flatCameraCFrame = CFrame.new(Camera.CFrame.Position, Camera.CFrame.Position + Camera.CFrame.LookVector * Vector3.new(1, 0, 1))
	local pointRelativeToCamera = Camera.CFrame:PointToObjectSpace(TargetPosition)
	local unitRelativeVector = (pointRelativeToCamera).Unit
    local rotation = math.atan2(unitRelativeVector.Z, unitRelativeVector.X)
	DMGIndicator.Rotation = math.deg(rotation)

sorry- how would you replicate this across a 2d space?

It already does, but in rotation, you can just place the ui in the middle of the screen

It doesn’t seem to be rotating properly…

I found a post covering a similar topic, tweaked it a bit, and found the answer- thank you anyway though. :smiley:

1 Like