Hi how work this => get_global_transform().basis

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

How does this line of code work?

onready var head = $Head
func _physics_process(delta):
var head_basis = head.get_global_transform().basis

Please help

:bust_in_silhouette: Reply From: mdubaisi

in the first line you create a variable with the name of “head” that refers to the “Head” node before the scene loads.
in the second line you started the PhysicsProcess(delta) that I’m not sure what it means but what I understand is that it does what’s inside it every physics frame.
in the last line you create a variable every physics frame with the name of
“headbasis” that stores the transform(position, rotation, scale) of the head but the basis thing is what I don’t understand, I’d like to see the tutorial that you got this code from.
so you basically store the head’s transform every physics frame.