Help with easy music error please!

Godot Version

3

i want to add some background music but when my player dies after it my music plays and plays after the old music how to fix it?
I tried to stop music after players death but its not worked(there was an error) so i dont now how to do it.

What was the error?

i have an autoplay maybe its the problem ?

I remember you from your last problem :sweat_smile:. Remove all code after your get_parent().playerDied(pop_effect_instance)-call. Then go to your Game.gd-script and put the music_player.stop()-call in the playerDied()-method

Yes😂,thanks i will try soon

Omg, i think my game is deleted, My lights were turned off and now my scene won’t open, what should I do?


:sob: :sob: :sob: what to do

First you can try to restart Godot. If it still doesnt work you have to open up your Game.tscn in your file manager outside of Godot and send a screenshot

i tried to restart not worked.you mean to open there yes?

Yes open the Game.tscn in any texteditor. In there we have to find the corrupted lines. What did you do before the Scene got corrupted?

nothing i was coding and then my lights shut down after that this error

[gd_scene load_steps=14 format=2]

[ext_resource path=“res://Scenes/Player.tscn” type=“PackedScene” id=1]
[ext_resource path=“res://Scenes/Bullet.tscn” type=“PackedScene” id=2]
[ext_resource path=“res://Scenes/Background.tscn” type=“PackedScene” id=3]
[ext_resource path=“res://Scenes/Enemy.tscn” type=“PackedScene” id=4]
[ext_resource path=“res://Scenes/Game.gd” type=“Script” id=5]
[ext_resource path=“res://Scenes/pop.tscn” type=“PackedScene” id=6]
[ext_resource path=“res://Scenes/Timer.tscn” type=“PackedScene” id=7]
[ext_resource path=“res://Scenes/Borders.tscn” type=“PackedScene” id=8]
[ext_resource path=“res://Scripts/pop.gd” type=“Script” id=9]
[ext_resource path=“res://Scripts/Highscore.gd” type=“Script” id=10]
[ext_resource path=“res://Fonts/CuteFont-Regular.ttf” type=“DynamicFontData” id=11]
[ext_resource path=“res://Scenes/Game.tscn” type=“PackedScene” id=12]

[sub_resource type=“DynamicFont” id=1]
size = 100
font_data = ExtResource( 11 )

[node name=“Game” type=“Node2D”]
position = Vector2( 396, 441 )
script = ExtResource( 5 )
meta = {
edit_horizontal_guides”: [ 500.0 ],
edit_vertical_guides”: [ 500.0 ]
}

[node name=“Borders” parent=“.” instance=ExtResource( 8 )]
position = Vector2( -396, -440 )

[node name=“Player” parent=“.” instance=ExtResource( 1 )]
position = Vector2( 100, 100 )
z_index = 5

[node name=“pop” parent=“Player” instance=ExtResource( 6 )]
position = Vector2( 0, -6 )
script = ExtResource( 9 )

[node name=“PopSound” parent=“Player” instance=ExtResource( 12 )]

[node name=“Enemy” parent=“.” instance=ExtResource( 4 )]
position = Vector2( 104, 489 )
collision_layer = 4

[node name=“Bullet” parent=“.” instance=ExtResource( 2 )]
position = Vector2( 1044, 33 )
collision_layer = 2

[node name=“Timer1” parent=“.” instance=ExtResource( 7 )]
self_modulate = Color( 0, 0, 0, 1 )
margin_left = 72.0
margin_top = -413.0
margin_right = 136.0
margin_bottom = -262.0
align = 1
valign = 1

[node name=“Highscore” type=“Label” parent=“.”]
margin_left = -199.0
margin_top = 234.0
margin_right = 107.0
margin_bottom = 385.0
custom_fonts/font = SubResource( 1 )
text = "Highscore "
align = 1
valign = 1
script = ExtResource( 10 )

[node name=“Background” parent=“.” instance=ExtResource( 3 )]
position = Vector2( -396, -439 )
z_index = -5
meta = {
edit_lock”: true
}

thats whats inside

Have you tried clicking on “Fix dependencies”?

yes, at first there was another error it was named deathsound then i changed, and it gives me this error,i deleted deathsound scene from godot

if i am right i need to delete all things with “game” yes in previos code?

Wait is the scene still corrupted?

yes i cant open it


this maybe helpful