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.
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.
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.
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.