Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

FlxSound time always resulting in 0 (Flixel 6.0.0) #3386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BeastTornado opened this issue Mar 4, 2025 · 1 comment
Closed

FlxSound time always resulting in 0 (Flixel 6.0.0) #3386

BeastTornado opened this issue Mar 4, 2025 · 1 comment

Comments

@BeastTornado
Copy link

When accessing a playing FlxSound the "time" float is always 0 UNLESS it is set. Setting works but getting it does not.

Image

Here I have my PlayState and MusicHandler both attempting to grab the "time" value separately yet it's always at zero while the elapsed time still rises (as shown by the conductor.) It seems that even though the stream is playing it isn't setting the time on update as it should be

@Geokureli
Copy link
Member

Geokureli commented Mar 4, 2025

time is set in the sound's update method, which is only called automatically if it's in a sound group. sounds are automatically added to sound groups if you play them via: FlxG.sound.play, FlxG.sound.load or FlxG.sound.playMusic. You can also add them to FlxG.sound.defaultSoundGroup manually.

I know this is weird, and it seems like time should just read the underlying sound's position. we may make that change, it's being discussed, here: #3272

@HaxeFlixel HaxeFlixel locked and limited conversation to collaborators Mar 27, 2025
@Geokureli Geokureli converted this issue into discussion #3404 Mar 27, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants