global vector to local vector

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

Hi.
I need help.
I want to convert a global vector to a vector based on the player’s axis.
It is like this↓

This is 3D Vector.
In short, I want to find out how I am moving from my point of view

I’m japanese. so I’m not good at English.
Sorry for my poor English.

:bust_in_silhouette: Reply From: Bush2Tree

Maybe to_global() and to_local() under Spatial can help you?

https://docs.godotengine.org/en/stable/classes/class_spatial.html#class-spatial-method-to-global

https://docs.godotengine.org/en/stable/classes/class_spatial.html#class-spatial-method-to-local