Proximity Prompt trigger breaks when moved locally

So I am trying to use a ProximityPrompt for my NPCs that users can speak to. Until now, all of my NPCs were stationary. Now I want some that are moved throughout the world via a local script (just calling PivotTo to change the NPCs CFrame). However, whenever I move the NPC away from where they originally are placed in the world, the trigger for their proximity prompt no longer works. I still see the prompt, but triggering it does nothing unless I drag the NPC (locally) near where it was initially.

Are there any workarounds to this? I have tried copying and repasting the prompt into the moved NPC as well as disabling, moving, then enabling it again but none of that seems to be working.

Thanks!
robloxapp-20231007-0109268.wmv (2.7 MB)

Can you record a video to showcase this?

(Upload or Gyazo or Streamable)

Just attached an upload. Showcases how the moved NPC doesn’t trigger the prompt, but when I drag him back to his starting position, all works as expected.

Are you absolutely sure you have the ProximetyPrompt in the NPC, or is it in a part that’s stationary and when the NPC moves away it won’t work?

Considering I can still approach the prompt and see it wherever the NPC goes to, yeah I am sure. It is within a part that is inside of the NPCs model.

I just saw that, but I mistakenly thought the original position in the video was its starting position, not the position by the water.

You mentioned locally. Do you mean the NPC is only on the client, or is it on the server?
try Testing it by pressing Start instead of the other settings. This’ll show you what is happening on the client and server.
I just wondered if you moving the NPC with the drag handles was only moving it on the client when you playtest it without the server.

The NPC exists on the server, but it’s CFrame is modified via a local script. The video starts in the position the NPC is moved to locally. The spot by the water is where the NPC exists on the server at all times. It’s as if the proximity prompt is only triggering when I am close to its position on the server.

If you move the NPC on the Client
And handle the Prompt input on the Server

Proximity Prompt stays in the server.
Proximity Prompt has a max range and that is exceeded.

So for example say you have server NPC on (0,0,0) and Client NPC on (0,500,0)

When you trigger the prompt, first Roblox checks if it is in range, as in your position - prompt position, which is 500 in this case.

Say you set the Range as 1000 then it’d work. Otherwise it’ll fail.

If you’re wondering what “Range” I’m talking about, it’s probably called MaxDistanceActivation in properties of the Prompt.

1 Like

Why not move it on the server instead of using a local script?
If it’s local then it also be exploited if the NPC abilities & prompt allow a player to cheat my moving the NPC closer to them.

^ Just to prevent this, Roblox doesn’t allow activation after a certain range. Well technically setting it to math.huge makes the range infinite but definitely not recommended.

I am wondering if it is just because I don’t initially create the proximity prompt on the client. That’s probably it honestly. I will try it out tomorrow and get back to you.

Yes, but if you are only supposed to be able to enable the prompt from 10 studs away for a game upgrade (for example, the NPCs give you money) and a hacker just moves all the NPCs to their position they could claim the money from all the NPCs.
If this was all done on the server then we can see from @corncob567’s video it would keep the NPCs prompts from doing anything if the hacker moved the NPCs on their own client.

I have to move it locally, as the NPCs movement only occurs as the result of a player’s progress along a quest. Each player should see that NPC in a particular position depending upon how far along in the quest they are.