Skip to content

Commit

Permalink
Use the newly introduced is not operator
Browse files Browse the repository at this point in the history
  • Loading branch information
0stam committed Aug 17, 2024
1 parent 42145e8 commit c47fb55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tutorials/scripting/gdscript/static_typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ get full autocompletion on the player variable thanks to that cast.
in some cases, it can also lead to bugs. Use the ``as`` keyword only if this
behavior is intended. A safer alternative is to use the ``is`` keyword::

if not (body is PlayerController):
if body is not PlayerController:
push_error("Bug: body is not PlayerController.")

var player: PlayerController = body
Expand Down

0 comments on commit c47fb55

Please sign in to comment.