mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +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];
|
||||
if (isLocalPlayer) {
|
||||
transform.position = _body.position - sectorTransform.position;
|
||||
transform.rotation = _body.rotation * Quaternion.Inverse(sectorTransform.rotation);
|
||||
transform.position = sectorTransform.InverseTransformPoint(_body.position);
|
||||
transform.rotation = sectorTransform.InverseTransformRotation(_body.rotation);
|
||||
} else {
|
||||
_body.position = Vector3.Lerp(_body.position, sectorTransform.position + transform.position, _smoothSpeed * Time.deltaTime);
|
||||
_body.rotation = transform.rotation * sectorTransform.rotation;
|
||||
//var lerpPosition = Vector3.Lerp(_body.position, sectorTransform.TransformPoint(transform.position), _smoothSpeed * Time.deltaTime);
|
||||
_body.position = sectorTransform.TransformPoint(transform.position);
|
||||
_body.rotation = sectorTransform.rotation * transform.rotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user