GDScript basic methods

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DimitriyPS
:warning: Old Version Published before Godot 3 was released.

I need some basic methods. Don’t know how to find them. Please tell me.

  1. For 3D. Method to convert local coordinates of the node in global coordinates ?
  2. A method that would return the fractional part of the number.
  3. A method that would return the integer portion of a number.
:bust_in_silhouette: Reply From: Zylann

node.get_global_transform().get_translation()
2.
x - floor(x) (unsigned)
x - int(x) (signed)
3.
int(x)

Many thanks!

DimitriyPS | 2016-05-30 15:05

:bust_in_silhouette: Reply From: DimitriyPS
  1. node.get_global_transform().get_translation()

It’s not working. Tell me how?

Try get_node("MyNode").get_global_transform().origin.

Calinou | 2016-06-14 19:22

Calinou , I came back to this task and check what you advised. It works, thank you very much.

DimitriyPS | 2016-06-27 07:29