0 votes

I'm using the is operator to check if an object is a RigidBody for example, but I can't fine a way to check if it's not a RigidBody.
I've tried is not RigidBody, is !RigidBody, !RigidBody, all things that I could imagine working, but they all give script errors.
How is this meant to be done? Right now all I could get to work is a blank if statement, with the logic in the else section. This is not ideal and there must be some way this is meant to be done!

Godot version 3.3.2
in Engine by (612 points)

1 Answer

+4 votes
Best answer

if not (your_variable is RigidBody):
I think the parenthesis are optional.

by (3,389 points)
selected by
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 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.