Answered
0
0

I’m implementing some weapon shooting mechanics from code. At some point, I’d like to play fmod event for weapon fire.

I have a UPROPERTY reference
UFMODEvent* FireSound;
I call
UFMODBlueprintStatics::PlayEventAttached(Sound, MuzzleDirection, NAME_None, FVector(), EAttachLocation::Type::SnapToTarget, false, true);
(MuzzleDirection is an arrow component that points form the muzzle, it’s always valid).

Sound artist loads his banks and sets up FireSound from the editor.

Problem is, this works, but fails randomly (every shot except first one can be heard…). Sometimes just inserting any kind of unrelated instruction (like print to log call) before PlayEventAttached call makes it either stop working alltogether (no sound played at all), or makes it work 100% times. I have a feeling the problem could have something to do with resource laoding, but I really can’t find what I’m doing wrong.

Help :(

  • You must to post comments
Best Answer
0
0

Please see the answer in the following post regarding early loading of some blueprints and how to make sure FMOD is loaded first. There is a good chance this could explain what you are seeing.

http://www.fmod.org/questions/question/cannot-play-fmod-events-in-package-build/

  • Davor

    It sounded like something that could eplain my problems, but unfortunately we don’t even use c++ base for our gamemode at this point. Is there anything in blueprints that could be using the same kind of issues?

  • Geoff Carlton

    Is there any other c++ code that uses FClassFinder? Can you search for it in your project and see if it shows up anywhere?

  • You must to post comments
0
0

Could you contact support@fmod.com and we can chase that up. I’d like to get some more details, and if possible a cut down project that demonstrates the problem.

  • Davor

    I will, thanx!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.