+5 votes

When I tried to write

if something:
    do something
else if another thing:
    do another thing

Why I am getting error in else if?

in Engine by (45 points)

Never mind I was doing this c++ way :)

1 Answer

+10 votes
Best answer

use elif rather than else if

if [expression]:
    statement(s)
elif [expression]:
     statement(s)
else:
    statement(s)

if/elif/else

by (123 points)
selected by

I got it after posting the question. Almost forgot about elif.

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 webmaster@godotengine.org with your username.