Open chriztheanvill opened 8 months ago
Not sure I understood this correctly, but if you want to stop the audio, you should just call the AudioStreamPlayer
's stop()
method. I think calling set_process_mode()
on the AudioStreamPlayer
or one of its ancestors does nothing, because it just handles starting and stopping the audio and doesn't do much "processing" in Godot's "do something once per frame" sense.
Not sure I understood this correctly, but if you want to stop the audio, you should just call the
AudioStreamPlayer
'sstop()
method. I think callingset_process_mode()
on theAudioStreamPlayer
or one of its ancestors does nothing, because it just handles starting and stopping the audio and doesn't do much "processing" in Godot's "do something once per frame" sense.
In the Level Cpp script the music (audioStreamer...) the autoplay is on, but I set:
// Level00
if (Engine::get_singleton()->is_editor_hint()) // Tried in the Constructor or _read function, still the same
set_process_mode(Node::ProcessMode::PROCESS_MODE_DISABLED);
So, even if I dont start the game: F5 or Run Project the music starts.
// ---
if (Engine::get_singleton()->is_editor_hint()) // Tried in the Constructor or _read function, still the same
set_process_mode(Node::ProcessMode::PROCESS_MODE_DISABLED);
Also, I have made a script that made transitions made in Cpp, if in the Autoload options, if I disable it, still working:
So you're saying that the AudioStreamPlayer
is part of your level and has Autoplay
enabled and you want it to start playing when the scene loads and
StoreConfigs.tscn
is not set up as an Autoload, then the music plays when the game is started,StoreConfigs.tscn
is set up as an Autoload, then the music does not play when the game is started?If that's the case, then something in StoreConfigs.tscn
might interfere with the audio player.
Also, since your screenshot is cut off just above the Autoplay
property, please note that Playing
and Autoplay
are two different things. Playing
is just the current (preview) state. Setting that in the Editor won't affect what happens when you run the game.
So you're saying that the
AudioStreamPlayer
is part of your level and hasAutoplay
enabled and you want it to start playing when the scene loads and
- if
StoreConfigs.tscn
is not set up as an Autoload, then the music plays when the game is started,- if
StoreConfigs.tscn
is set up as an Autoload, then the music does not play when the game is started?If that's the case, then something in
StoreConfigs.tscn
might interfere with the audio player.Also, since your screenshot is cut off just above the
Autoplay
property, please note thatPlaying
andAutoplay
are two different things.Playing
is just the current (preview) state. Setting that in the Editor won't affect what happens when you run the game.
Mmm ... the thing is: Right now in the Level00 cpp I set to music autoplay to true. also I have this in the Level00 cpp
// Level00.cpp
if (Engine::get_singleton()->is_editor_hint()) // Tried in the Constructor or _read function, still the same
set_process_mode(Node::ProcessMode::PROCESS_MODE_DISABLED);
While Not running the game: pressing F5 or Run Project.
set_process_mode(Node::ProcessMode::PROCESS_MODE_DISABLED);
Tested versions
Since 4.1 to current 4.2.1
System information
Godot v4.2.1.stable - openSUSE Tumbleweed 20231208 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (RADV NAVI23) () - AMD Ryzen 7 5700G with Radeon Graphics (16 Threads)
Issue description
Note: Every node I made it in GDextension C++ After adding a scene to autoloads, some other scenes/nodes have a weird behavior. In this case, I have a scene: Level01 made in GDextension and has the node Music (audioStream...) and set it to autoplay true. Even if I set this, Keeps playing:
if (Engine::get_singleton()->is_editor_hint()) set_process_mode(Node::ProcessMode::PROCESS_MODE_DISABLED);
Or my Player (also made in GDextension), the camera does not follow the player. `Also I have a scene transition (also made in GDextensions) if I disable it in the Autoloads options, still visible.
Steps to reproduce
If I create a node with GDextension C++, then add it to a scene, save it, like:
Minimal reproduction project (MRP)
Could be posible with a started project, just add a scene with the steps that I listed and happens.