ProximityPrompt won't pop up

I’m attempting to make an NPC system which will flash a ProximityPrompt whenever you’re in suitable range to talk to the NPC.

The problem I’m having is that whenever I use a script to create a ProximityPrompt and distribute it to the NPCS with the “NPC” tag, the object is created and is placed where it’s programmed to be but the proximity prompt does not visually appear whenever I’m in range of the prompt part.

Script:

local CollectionService = game:GetService("CollectionService")
local NPCS = CollectionService:GetTagged("NPC")

for _, npc in pairs(NPCS) do
	local prompt = Instance.new("ProximityPrompt")
	prompt.ActionText = "Talk"
	prompt.Parent = npc.Parent:FindFirstChild("PromptPart")
end

What’s the problem here?

The issue could be the RequiresLineOfSight option being on.
Maybe try and add prompt.RequiresLineOfSight = false and see if that fixes it.

2 Likes

This solution works! Thanks a lot!

No problem!
Glad I could help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.