How to Access "Looping" Property of Sound Component [SOLVED]

I’ll admit I’m probably using the sound component incorrectly if I am please let me know. Here’s my problem:

My player has access to fire two weapons simultaneously and each weapon has sounds that will play depending on the weapons state. Instead of creating a sound component for each sound I decided to create one sound component for each weapon and change the “sound” property to the appropriate sound when needed. The issue is one state of the weapon is “overheated” and I would like to change the “Looping” property of the sound component to “True” for this and switch it back to “False” when I switch back to a shooting sound.

This doesn’t appear to be a property you can access according to this: Sound Component API

This may not be possible, but I wanted to check with the community just in case it was.

I’m sure there is a better way of doing it but you could use 2 sound components one with looping enabled. Whenever a looped sound is needed, use the one with looping. If not use the other one

1 Like

I guess I could do that. I think I have to experiment more. This is my first time working with the sound component so I think I must be missing something.

The loop property is not available at runtime:

I would do like Asatte suggests and have two sound components, one with looping enabled and with without.

1 Like

Thank you for the reply. I will switch to doing that.

1 Like