Sound doesn't play when it should? UE5

Hey

I have this problem with my blueprint you can see below. The way it should work is if the player presses F it checks if he is trying to open Office Door, if no it just opens the door, however if yes it goes to another branch, which checks if the player has a key, if yes it opens the door, if no it should play a sound of locked door.

However, if the player has a key, the office door indeed opens, if he doesn’t have a key tho, the door won’t open but it also won’t play the Locked Door Cue as I set it to do. Considering the sound cue worked before I’m not sure why this is.

Any answers are apreciated!

1 Like

You’re playing all the sounds at (0,0,0) rather than a location relative to/near the door, which could be why you don’t hear the sound if the door is further from the origin than when originally tested.

1 Like

Hey

So I just tried playing it at the location of the door, and sadly that wasn’t it. Also what I just tried, is instead of playing a sound, creating a widget and adding it to viewport, once again didn’t work which makes it seem like the False event isn’t even going off. I never had anything like that happen to me, if it’s not true, it must be false right?

It’s not super clear to me what your various variables from the player character and door are so I’m not sure exactly where things might be breaking - my suggestion would be to use either breakpoints (F9 on a node) or Print String nodes to detect where the logic is getting to and seeing what the variable values are. Hope that helps :slight_smile:

1 Like

Wow, I haven’t heard of breakpoints, I will try both suggestions tommorow, thank you

1 Like

Alright, it took me a good hour to get it working, but I got there in the end! For some reason I used SetACtor instead of GetACtor, which then didn’t deliver the correct result and the whole blueprint broke, I also had a few mistakes in my FirstPersonCharacter blueprint.

Honestly breakpoints are amazing, thank you for telling me about them because I can see myself using them a lot in the future. And thank you for helping me solve this!

1 Like