Hi,
I added a custom proximity prompt to my mesh. The prompt works as intended, but there’s a feature I’d like to add that’s not working properly for me.
When the proximity prompt is shown, it’s supposed to enable the highlight that’s inside the mesh, but it doesn’t activate correctly. When I run the game, the highlight is already showing, which is not supposed to happen. The highlight is only supposed to show when the prompt is showing.
What am I doing wrong?
This is the Prompt localscript inside StarterPlayerScripts:
local camera = workspace:WaitForChild("CameraMesh")
local prompt = camera:WaitForChild("ProximityPrompt")
local gui = camera:WaitForChild("Mesh_Prompt")
local highlight = camera:WaitForChild("Highlight")
local actionText = gui:WaitForChild("ActionText")
local keyInput = gui:WaitForChild("KeyInput")
highlight.OutlineTransparency = 1
highlight.Enabled = true
highlight.DepthMode = Enum.HighlightDepthMode.Occluded
prompt.PromptShown:Connect(function()
gui.Enabled = true
highlight.OutlineTransparency = 0
actionText.Text = actionText.Text
end)
prompt.PromptHidden:Connect(function()
gui.Enabled = false
highlight.OutlineTransparency = 1
end)
keyInput.MouseButton1Click:Connect(function()
prompt:InputBegan(game.Players.LocalPlayer)
end)
prompt.Triggered:Connect(function(player)
print("it works!!")
end)