mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Prediction: physics copy now has the correct layer assigned to fix predicted objects falling through the ground in games which use custom physics collision matrix
This commit is contained in:
parent
3e254f9ef9
commit
673500b226
@ -208,6 +208,10 @@ protected virtual void CreateGhosts()
|
||||
physicsCopy.transform.rotation = transform.rotation;
|
||||
physicsCopy.transform.localScale = transform.localScale;
|
||||
|
||||
// assign the same Layer for the physics copy.
|
||||
// games may use a custom physics collision matrix, layer matters.
|
||||
physicsCopy.layer = gameObject.layer;
|
||||
|
||||
// add the PredictedRigidbodyPhysical component
|
||||
PredictedRigidbodyPhysicsGhost physicsGhostRigidbody = physicsCopy.AddComponent<PredictedRigidbodyPhysicsGhost>();
|
||||
physicsGhostRigidbody.target = this;
|
||||
|
Loading…
Reference in New Issue
Block a user