. . . Posted October 4, 2021 Share Posted October 4, 2021 I want to play sounds for just 1 player and not everyone in the radius. I've looked into Woodie a lot and see he uses "TheFocalPoint" for his music as well most sounds which are only heard by 1 player like crafting sounds and stuff use it too, but I have no idea how I would even use this. And even if I could use it would it work for playing any sound whenever I want or can you only make it play specific sounds? Link to comment https://forums.kleientertainment.com/forums/topic/134206-is-there-any-way-to-play-a-sound-for-just-one-player/ Share on other sites More sharing options...
Monti18 Posted October 5, 2021 Share Posted October 5, 2021 (edited) TheFocalPoint is just an entity that is a children of the player. It has a soundemitter, so you can use it the same way you do it for a player. When world.lua is initialized: assert(TheFocalPoint == nil) TheFocalPoint = SpawnPrefab("focalpoint") this is called. TheFocalPoint then listens for the event when a player joins and attaches itself to him. So let's say you had a sound you would like play, you would normally do something like this: inst.SoundEmitter:PlayingSound("dontstarve/characters/woodie/goose/flap") If you want only the player to hear it, you just use TheFocalPoint. TheFocalPoint.SoundEmitter:PlayingSound("dontstarve/characters/woodie/goose/flap") As the player is the parent entity, the sound will play where the player is. So you can use it the same way as you would play sounds for everyone to hear. Edited October 5, 2021 by Monti18 Link to comment https://forums.kleientertainment.com/forums/topic/134206-is-there-any-way-to-play-a-sound-for-just-one-player/#findComment-1501873 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now