Animations and Sounds play in a certain area or touched event

Hello.

I’m trying to make an actual “Player to NPC Dioulge” with a real voice over the top of it and animations playing. I’m trying to make it a touched event, which I want it but can’t figure out how to make it work.

Any tips on how to play the sound and animations of an NPC on a touched event. (Or different methods)

2 Likes

You could make an invisible hit box and have a local script fire and event when it’s touched. The event will then be triggered on a server script and tell the npc to play animation and sounds

Quick note, I’m not an experience scripter, so if I’m wrong tell me.

You could use magnitude and then if the person is in your desired magnitude can press a keybind and play the dialogue. For the sounds, you’d have to pay Robux, but that is simple as well. You activate the sounds you want when the NPC is speaking and animations. There are plenty of posts on how to do that, many of them solved actually and countless of YouTube videos. You don’t always need to be specific, like how to create NPC with sounds and animations, but rather search for general topics, such as how to make a NPC with dialogue, how to animate and script the animations, how to play sounds. It needs a lot of work and combining the knowledge you find regarding scripting, but at the end of the day, you’d have your NPC.

Magnitude is a way of scripting your dialogue, but you can also use the touched event. Do whichever you find way more helpful/easier. I wish good luck!

1 Like

Thank you, I’ll start studying that now.

i would use region3 for detecting when someone is in-range, and then of course Animator:LoadAnimation(), and play sounds at certain keyframe points.

Remember, if a reply answered your Question , you have to mark it as the solution, so people won’t get confused and answer it again! I wish good luck and if you ever face any issues, my DMs are open.