godot icon indicating copy to clipboard operation
godot copied to clipboard

StreamPlayer Loop Restart Time not a float but int in inspector

Open RayKoopa opened this issue 10 years ago • 3 comments

Operating system or device: Windows 10 Pro, Godot 2.0.2 stable

Issue description (what happened, and what was expected): The StreamPlayer class provides the float property "Loop Restart Time" and corresponding functions to get and set the value. The value specifies the time in seconds at which a looping stream is rewound to. The inspector erroneously displays it as an Integer property, and thus makes it very inexact / useless. A script which uses set_loop_restart_time(float) to properly set a float value for it is the only workaround.

Steps to reproduce: Create a StreamPlayer. Try to set a float value for "Loop Restart Time" in the inspector. Since the field is an Integer there, it will be rounded to the next Integer, setting the loop time exactly is impossible without a script.

RayKoopa avatar Apr 17 '16 19:04 RayKoopa

Looks like it happens here

I think setting it to Variant::REAL should work though...

Alex-doc avatar Apr 17 '16 19:04 Alex-doc

Yep! The property works flawless other than the inspector display fault. It made me wonder a bit if it's the sample or a time to be rewound to, as the tooltip isn't clear about that either. I'd fix it, but I'm not feeling safe enough on GitHub yet and better let the pro's do that ;) It's amazing this engine offers this feature, by the way - most prominent engines lack it out of the box, yet it's so important for high quality background music techniques...

RayKoopa avatar Apr 17 '16 19:04 RayKoopa

Now going to test!

Alex-doc avatar Apr 17 '16 19:04 Alex-doc