mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
More stable movement
This commit is contained in:
parent
3f50c54221
commit
452e61ff41
@ -62,11 +62,12 @@ namespace QSB {
|
|||||||
|
|
||||||
var sectorTransform = QSB.playerSectors[netId.Value];
|
var sectorTransform = QSB.playerSectors[netId.Value];
|
||||||
if (isLocalPlayer) {
|
if (isLocalPlayer) {
|
||||||
transform.position = _body.position - sectorTransform.position;
|
transform.position = sectorTransform.InverseTransformPoint(_body.position);
|
||||||
transform.rotation = _body.rotation * Quaternion.Inverse(sectorTransform.rotation);
|
transform.rotation = sectorTransform.InverseTransformRotation(_body.rotation);
|
||||||
} else {
|
} else {
|
||||||
_body.position = Vector3.Lerp(_body.position, sectorTransform.position + transform.position, _smoothSpeed * Time.deltaTime);
|
//var lerpPosition = Vector3.Lerp(_body.position, sectorTransform.TransformPoint(transform.position), _smoothSpeed * Time.deltaTime);
|
||||||
_body.rotation = transform.rotation * sectorTransform.rotation;
|
_body.position = sectorTransform.TransformPoint(transform.position);
|
||||||
|
_body.rotation = sectorTransform.rotation * transform.rotation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user