mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
fix(NetworkRigidbody Components): Added missing OnTeleport overrides (#3788)
* Updated NetworkRigidbody Components for fix teleportation issues fix teleportation issue * Optimizes Usage of Physic.SyncTransform.
This commit is contained in:
parent
4fe0720070
commit
7c4ded37a2
@ -92,5 +92,20 @@ protected override void OnValidate()
|
|||||||
Debug.LogWarning($"{name}'s NetworkRigidbody.target {target.name} is missing a Rigidbody", this);
|
Debug.LogWarning($"{name}'s NetworkRigidbody.target {target.name} is missing a Rigidbody", this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnTeleport(Vector3 destination)
|
||||||
|
{
|
||||||
|
base.OnTeleport(destination);
|
||||||
|
|
||||||
|
rb.position = transform.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnTeleport(Vector3 destination, Quaternion rotation)
|
||||||
|
{
|
||||||
|
base.OnTeleport(destination, rotation);
|
||||||
|
|
||||||
|
rb.position = transform.position;
|
||||||
|
rb.rotation = transform.rotation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,5 +92,20 @@ protected override void OnValidate()
|
|||||||
Debug.LogWarning($"{name}'s NetworkRigidbody2D.target {target.name} is missing a Rigidbody2D", this);
|
Debug.LogWarning($"{name}'s NetworkRigidbody2D.target {target.name} is missing a Rigidbody2D", this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnTeleport(Vector3 destination)
|
||||||
|
{
|
||||||
|
base.OnTeleport(destination);
|
||||||
|
|
||||||
|
rb.position = transform.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnTeleport(Vector3 destination, Quaternion rotation)
|
||||||
|
{
|
||||||
|
base.OnTeleport(destination, rotation);
|
||||||
|
|
||||||
|
rb.position = transform.position;
|
||||||
|
rb.rotation = transform.rotation.eulerAngles.z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,5 +92,20 @@ protected override void OnValidate()
|
|||||||
Debug.LogWarning($"{name}'s NetworkRigidbody.target {target.name} is missing a Rigidbody", this);
|
Debug.LogWarning($"{name}'s NetworkRigidbody.target {target.name} is missing a Rigidbody", this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnTeleport(Vector3 destination)
|
||||||
|
{
|
||||||
|
base.OnTeleport(destination);
|
||||||
|
|
||||||
|
rb.position = transform.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnTeleport(Vector3 destination, Quaternion rotation)
|
||||||
|
{
|
||||||
|
base.OnTeleport(destination, rotation);
|
||||||
|
|
||||||
|
rb.position = transform.position;
|
||||||
|
rb.rotation = transform.rotation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,5 +92,20 @@ protected override void OnValidate()
|
|||||||
Debug.LogWarning($"{name}'s NetworkRigidbody2D.target {target.name} is missing a Rigidbody2D", this);
|
Debug.LogWarning($"{name}'s NetworkRigidbody2D.target {target.name} is missing a Rigidbody2D", this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnTeleport(Vector3 destination)
|
||||||
|
{
|
||||||
|
base.OnTeleport(destination);
|
||||||
|
|
||||||
|
rb.position = transform.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnTeleport(Vector3 destination, Quaternion rotation)
|
||||||
|
{
|
||||||
|
base.OnTeleport(destination, rotation);
|
||||||
|
|
||||||
|
rb.position = transform.position;
|
||||||
|
rb.rotation = transform.rotation.eulerAngles.z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user