Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a proximity sensor on an NPC?

I know this is not a request site but I'm not sure where to start. My game is FE obviously. Basically I have an NPC when you walk up to them I want a chat to show up, a chat GUI that I create, and I'm not sure where to start

4 comments

0

Not a request site!

0

Not looking for someone to make the script for me, just to point me in the right direction.

0

I’ll help, but what do you mean by proximity sensor.

0

I have a NPC, when a player walks up to the NPC I want to move the camera to focus on the NPC and bring up a GUI that I created. I can do the camera and GUI, just don't know how to grab the player.

1 answer

✓ Accepted answer

You can put an invisible block around the npc, anchor it, and use the .Touched event.

A less efficient way is continually check the magnitude of both the player and the npc to trigger the encounter.

If you aren’t familiar with magnitude it’s how far the two positions are apart.

The way to use magnitude is (position1 - position2).Magnitude

Hope this helps.

1 comment

0

Thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.