Proximity prompt wont show up

I want to make a phone charging system but for some reason the proximity prompt doesnt show up when i come up to the electrical socket even though i placed the proximity prompt in it

Heres the script:

script.Parent.Triggered:Connect(function(player)
workspace:WaitForChild(player.Name).PCharge.Value = 100
end)

the model of the electrical socket:
Скриншот 18-07-2022 042048

and also the video of how i come up to it

any suggestions or stuff like that would be really appreciated

Click on the ProximityPrompt and then use the move feature which you would move parts on Roblox to ensure that the little ball (which should be where the ProximityPrompt is) is in the correct area where the player can interact with it.

Edit: Ignore me I swear that used to be a thing but I can’t see it any more when I try.

I clicked it and pressed the move tool,but for some reason i cant see the ball

Is it enabled in the properties?

Try this

local proximity = script.Parent.ProximityPrompt
local ProximityPromptService = game:GetService("ProximityPromptService")
proximity.Triggered:Connect(function(player)
workspace:WaitForChild(player.Name).PCharge.Value = 100
end)

How would that fix the issue? The issue is that the prompt will not show so it should not bean issue with the code.

Then the only solution would be to move script outside proximity and inside the part rather.

Replied to a wrong post but its enabled
image

Move script outside proximity prompt like this:
image
and change the script to this

local proximity = script.Parent.ProximityPrompt
local ProximityPromptService = game:GetService("ProximityPromptService")
proximity.Triggered:Connect(function()
	-- your code here
end)

Did not work even after fully copying the code

Quite strange, i’ve tried it on my studio and it worked fine
image
Are you sure you moved the script OUTSIDE proximity prompt?

1 Like

It should not at all affect if the prompt shows or not. I don’t think you really understand that the issue the user has is the prompt will not show NOT that the code will not work.

1 Like

An issue I have had with proximity prompts before is where due to a part being small it has not shown. You could try to add a larger part (but just make it transparent) and see if that works at all.

2 Likes

This too, try moving the part with proximity prompt outside the model itself and to an empty place instead and see if it works. since the model could be blocking the proximity prompt.

It probably has to do with the properties of your proximity prompt. Try disabling the “RequiresLineOfSight” property as it might be inside another part. If that doesn’t work try deleting the ProximityPrompt object and inserting a new one which has the default properties.

Also make sure the prompt part is anchored and check if it’s actually there when testing (hasn’t fallen through the map).

2 Likes

I just created a new proximity prompt and it started working for some reason

1 Like

You need to put the property: “RequiresLineOfSight”'s value on false, and while this will make it so that you can trigger the proximity prompt from behind the wall, you could also just make the range less, and even if not, it will definitely be trigger-able.

it was because of the “MaxActivationDistance”

Disable RequiresLineOfSight, it can probably be some object (or a transparent one) in front of the base object

1 Like