I need a GDscript to my object don't colision in the left and right of screen! Help me please!

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

How can I replace this GDscript:

if get_pos() . x > (640 - 50)
d = 0

My version is 3.0 and its no have this.


:bust_in_silhouette: Reply From: kidscancode

I’m not sure I understand what you’re asking, but get_pos() is a method from Godot 2.1. In 3.x, abbreviations were removed and direct property access is preferred.

Does this help?

if position.x > (640 - 50):
    d = 0