Open zachstronaut opened 8 months ago
Feel like you could certain do it this way too?
public static void TeleportInWorld( this NetworkTransform _ref, Vector3 _worldPosition, Quaternion _worldRotation )
{
Debug.Assert(_ref.CanCommitToTransform);
_ref.transform.position = _worldPosition;
_ref.transform.rotation = _worldRotation;
var newPos = _ref.InLocalSpace ? _ref.transform.localPosition : _ref.transform.position;
var newRot = _ref.InLocalSpace ? _ref.transform.localRotation : _ref.transform.rotation;
_ref.Teleport(newPos, newRot, _ref.transform.localScale);
}
I'm using an extension method right now: