How to Convert moveDirection.z = 20 to Local Space?

Hey guys,

Was wondering if somebody could help out? How can you convert:

moveDirection.z = 20;

to local space?

Is it possible?

Thanks!

1 Answer

1

Presuming you have that in a Vector3:

  var localVector = transform.InverseTransformDirection(moveDirection);

Yeah, that's what I was looking for. Thanks a million.