How to get global position in kinematicbody [godot 3D]?

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

Why I can’t using get_global_position().x in KinematicBody? what’s the solution?

My code:
if(tinge.get_global_position().x<self.get_global_position().x): Move += Vector3(-0.1,0,0)

then a message appears “Method ‘get_global_position’ is not declared in the current class

:bust_in_silhouette: Reply From: AiTechEye

because it is

tinge.global_transform.origin

try

if (tinge.global_transform.origin.x < global_transform.origin.x):
    Move += Vector3(-0.1,0,0)

Thank you it’s working

young.fernand | 2019-11-21 09:55