use MovePosition()/MoveRotation()

This commit is contained in:
in0finite 2022-04-28 21:03:37 +02:00
parent 92788d4db0
commit acf3f2a20d

View file

@ -271,7 +271,7 @@ namespace SanAndreasUnity.Net
private void SetPosition(Vector3 pos)
{
if (m_hasRigidBody)
m_rigidbody.position = pos;
m_rigidbody.MovePosition(pos);
else if (m_hasTransform)
m_transform.localPosition = pos;
}
@ -284,7 +284,7 @@ namespace SanAndreasUnity.Net
private void SetRotation(Quaternion rot)
{
if (m_hasRigidBody)
m_rigidbody.rotation = rot;
m_rigidbody.MoveRotation(rot);
else if (m_hasTransform)
m_transform.localRotation = rot;
}