Skip to content

Commit

Permalink
Check before destroying
Browse files Browse the repository at this point in the history
  • Loading branch information
Dariasteam committed Mar 4, 2019
1 parent 7f80bb0 commit 6d57f0a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Scenes/segment.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ func explode():
a.play("explode")

func meteorize():
get_node("REGULAR/StaticBody").queue_free()
var a = get_node("REGULAR/StaticBody")
if (a != null):
a.queue_free()
var mat = FixedMaterial.new()
var color = get_tree().get_nodes_in_group("player")[0].color
mat.set_parameter(FixedMaterial.PARAM_DIFFUSE, color)
Expand Down

0 comments on commit 6d57f0a

Please sign in to comment.