error parsing expression, misplaced else

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ragacakaci

func _process(delta):
if reach.is_colliding():
if reach.get_collider().get_name() == “Gun A”:
weapon_to_spawn = gun_a_hr.Instance()
elif reach.get_collider().get_name() == “Gun B”:
weapon_to_spawn = gun_b_hr.Instance()
else:
weapon_to_spawn = null
else: ( HERE IS ERROR)
weapon_to_spawn = null

if hand.get_child(0) != null:
	if hand.get_child(0).get_name() = "Gun A HR":
	weapon_to_drop = gun_a.instance()
	elif hand.get_child(0).get_name() == "Gun B HR":
		weapon_to_drop = gun_b.instance()
else:
	weapon_to_drop = null
:bust_in_silhouette: Reply From: Gluon

Well you havent formatted your code in your question so its very difficult to answer this but I would suggest you probably havent indented the lines correctly so the program thinks you have two else in a single if block which you cannot have. Without properly formatted code though I can only hazard a guess.