I wanted to teleport my character a bit forward by pressing a key and I noticed these two functions doesn’t return the same result:
LocalPlayer.Character.Position = LocalPlayer.Character.GetOffsetPosition(new Vector3(0.0f, 1.5f, 0.0f)); LocalPlayer.Character.Position = Function.Call<Vector3>(Hash.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS, LocalPlayer.Character, 0.0f, 1.5f, 0.0f);
GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS, the input vector is
Vector3(right/left, front/back, up/down).
Entity.GetOffsetPosition, it seems to be
Vector3(right/left, up/down, front/back).
Y and Z are switched.
Why does it behave like this?
I use the latest FiveM version (I had an update tonight) and also tried the latest CitizenFX version.