–1 vote

enter image description here

func process(delta):
if reach.is
colliding():
if reach.getcollider().getname() == "Gun A":
weapontospawn = gunahr.Instance()
elif reach.getcollider().getname() == "Gun B":
weapontospawn = gunbhr.Instance()
else:
weapontospawn = null
else: ( HERE IS ERROR)
weapontospawn = 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
Godot version godot 3
in Engine by (35 points)

1 Answer

+1 vote

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.

by (3,321 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.