Full auto weapon help

i have made a full auto weapon to use in engine but i have a issue with what i assume is the loop region length as when i quickly release mouse after 1 shot sometimes it will pay a second shot.
been trying to solve this for a while if i increase the loop region length it works fine but obviously changes the speed of the sound.

I’m not totally sure how your event works from your post, but given that your loop region is only ~100 ms long, I suspect that you’re running into scheduling issues.

When a logic marker has trigger conditions, the FMOD Engine evaluates those trigger conditions a few moments before the playback position reaches the marker. It does this because any audio that comes out of your speakers has to be scheduled and buffered a few moments before it actually plays, so FMOD has to know for certain which bits of your event will play a few moments in advance of when they actually do. This means that if you change whether a logic marker’s trigger conditions are met only a few moments before the playback position reaches that marker, the FMOD Engine might not have had enough time to change what the marker is scheduled to do.

FMOD interally updates every 20 ms (unless you change this setting via FMOD_STUDIO_ADVANCEDSETTINGS), and to ensure no gaps in timeline playback we schedule double that time in advance, so 40ms. It is possible to override these settings on a per-event-instance basis by using EventInstance::setProperty with FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY and FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD… But be warned that setting scheduling delay too low can result the FMOD Engine not having enough lead time to schedule sounds, and thus in your sounds not playing with sample-accurate timing.

That seems like a weird setup. Is it normal that the event can be in stopping state at the very beginning (to trigger the transition)?

On mouse down in game it should play this event and on mouse up it should stop the loop and continue to the end of the time line but when I click quickly to fire 1 shot it stops but plays it again its like fmod is not fast enough to set the condition.

But how is it possible for the event to be in stopping state BEFORE it has started to play?

That means it goes to the white marker if the event is stopped

No, since the condition test is only done once, at start. If you want to continuously test the condition throughout the event, you’ll need a transition region instead of a simple transition.

Oh thanks I will test that out