hi. i did my playsound footsteps in my animation of my game. its a multiplayer. then i tried to test game with 3 player windows. server and client. server is all normal. but when i try with my client it sounds like it plays two or 3 footstep sounds. then i did the same for client 2. same thing. only server is normal. is there something im missing?
Announcement
Collapse
No announcement yet.
Need help with play sound notifier in my animation
Collapse
X
-
Originally posted by Fruity Friend View Postis there something im missing?
-
Originally posted by unit23 View Postyou are multicast'ing the sounds reliable?
like this.
https://sta.sh/016atpqkr0d0
Comment
-
Originally posted by Fruity Friend View Post
i didnt use any event for that. well i use the anim notifier playsound.
like this.
https://sta.sh/016atpqkr0d0
Comment
-
Originally posted by Fruity Friend View Post
no luckstill multiple sounds
The notify event is only run from the animation blueprint? Sorry I cannot say more without knowing the code.
Basically you just need to run a function with the sound on Multicast, there is no other code needed to replicate a sound. Multicast replicates to all clients.
Comment
-
Originally posted by unit23 View PostIf the sound is played multiple times on your client side, then the function calling the footstep is called too often.
The notify event is only run from the animation blueprint? Sorry I cannot say more without knowing the code.
Basically you just need to run a function with the sound on Multicast, there is no other code needed to replicate a sound. Multicast replicates to all clients.
Comment
-
Your approach only is for client setup, remove the sounds and add a 'New Notify', call it Steps, see attached image, just use Multicast. Then add Event Notify Steps.... see image.
However, if you hear the sound multiple times, then this suggest that the player is replicated too fast, or too often... but I am really just guessing here, it depends on your network code, how the player is replicated.
Comment
-
Use "New notify" in AnimBP. You do not need to multicast or replicate anything because it will trigger every time when animation "hit" notifier on all clients by default.
You probably have different problem. Have you tested with compiled version of the game. Maybe when you test with 3 windows, you focus on one window and hear sound from other clients.
However, try to debug - print some message on notifiy event and see how many times it prints for one client.
Comment
-
Originally posted by Mr. Wood View PostUse "New notify" in AnimBP. You do not need to multicast or replicate anything because it will trigger every time when animation "hit" notifier on all clients by default.
You probably have different problem. Have you tested with compiled version of the game. Maybe when you test with 3 windows, you focus on one window and hear sound from other clients.
However, try to debug - print some message on notifiy event and see how many times it prints for one client.
so far its the same. server is all good. and client 1 and 2 music are mixing up together
Comment
-
Originally posted by Mr. Wood View PostUse "New notify" in AnimBP. You do not need to multicast or replicate anything because it will trigger every time when animation "hit" notifier on all clients by default.
You probably have different problem. Have you tested with compiled version of the game. Maybe when you test with 3 windows, you focus on one window and hear sound from other clients.
However, try to debug - print some message on notifiy event and see how many times it prints for one client.
Comment
-
Are you using blendspace for walking? Maybe this is just a theory but when you mix 2 animations (walk, run/sprint) and you have notifiers in both animations they will trigger when blended between.
Try to remove notifications from run (for example) and test it.
Also, use print in notifier event to debug. Make one step and see how many times it will output. I think I have similiar problem long time ago (could not remember what I did) and footsteps are almost always echoing (like trigger twice in short time for one step).
If all of these does not help remove all notifiers in animation, add one by one and always test when you add new notifier (so you can potencially notice where's the problem).
Comment
-
Originally posted by Mr. Wood View PostAlso maybe you can try this:
Set it to Highest Weighted AnimationLast edited by Fruity Friend; 11-13-2019, 02:50 PM.
Comment
-
Well it could be bug but maybe there's workaround.
Create a new bool variable in your AnimBP and call it for example "IsFootStepPlaying".
On your notify event connect "IsFootStepPlaying" to false with Playsound function and set bool to true. Use delay or timer, for example, 0.2 sec or so and set bool to false again, so it will play only one sound every 0.x seconds.
Comment
Comment