Stride Forums Archive

Transform translate

3 posts, 1753 views, 2017-07-03 to 2017-07-04

THEN3LLI (Daniele Cinelli) 2017-07-03 #1

Hi everyone,
i don’t know how to translate an object like in unity using Transform.Translate.
In Xenko i see only transform.position and i don’t know how to move the Entity following the direction of the axis updated by rotations.
Thanks in advance!

dfkeenan 2017-07-04 #2

I think all you would have to do is rotate the translation vector before adding it, i.e.

Entity.Transform.Position += Vector3.Transform(translation, Entity.Transform.Rotation);
THEN3LLI (Daniele Cinelli) 2017-07-04 #3

I didn’t knew Vector3 methods…
It worked for me, thank you!