Unity TransformDirection - Difference between transform.forward vs Vector3.forward

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

If I'm not wrong, as I understand, transform.forward will = the direction the forward of the object is facing according to the world, so if i'm looking in the X axis direction, transform.forward will return (1, 0, 0), so the X value of the vector3 = 1 cause the gameObject is looking in the direction of X axis, and transform.right will return (0, 0, -1), so the Z value of the vector3 is -1, since the right arrow of the object is facing opposite to the Z axis, it helps indicate directions of the object according to the world.


while Vector3.forward(.right)(.up) equals a constant, so .forward is(0, 0, 1), .right is (1, 0, 0), and .up is (0, 1, 0), it helps indicate directions according to the gameObject itself rather than the world.


If I'm wrong, I'm open for corrections cause this might be incorrect. but that's the best explanation.

youraveragesamiraenjoyer
Автор

Oh man, you've helped me a lot! Thanks and good luck to you!

xKingRognarx
Автор

Thank you. At least I finded solution for correct inertia of spaceship in first-person view. Almost all of tuts was about transform.direction and problem is that object change inertia movement while rotation, which is more suitable for flight simulation. And then i changed transform for Vector3, and it works as I expected!

alexkrat
Автор

though u have done a very good animation.. still i understood nothing...

entertainmentoverloaded
Автор

Abi keşke altına türkçe altyazı da koysaydın çok daha iyi olurdu.Türkçe kaynak bulmak cok sıkıntı

mervenazmumcu
join shbcf.ru