mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 09:32:38 +00:00
Smoooooth!
This commit is contained in:
parent
452e61ff41
commit
ee5b2b739e
@ -6,7 +6,6 @@ using UnityEngine.Networking;
|
|||||||
namespace QSB {
|
namespace QSB {
|
||||||
public class NetworkPlayer: NetworkBehaviour {
|
public class NetworkPlayer: NetworkBehaviour {
|
||||||
Transform _body;
|
Transform _body;
|
||||||
float _smoothSpeed = 10f;
|
|
||||||
public static NetworkPlayer localInstance { get; private set; }
|
public static NetworkPlayer localInstance { get; private set; }
|
||||||
|
|
||||||
void Start () {
|
void Start () {
|
||||||
@ -17,6 +16,8 @@ namespace QSB {
|
|||||||
}
|
}
|
||||||
QSB.playerSectors[netId.Value] = Locator.GetAstroObject(AstroObject.Name.TimberHearth).transform;
|
QSB.playerSectors[netId.Value] = Locator.GetAstroObject(AstroObject.Name.TimberHearth).transform;
|
||||||
|
|
||||||
|
transform.parent = Locator.GetRootTransform();
|
||||||
|
|
||||||
var player = Locator.GetPlayerBody().transform.Find("Traveller_HEA_Player_v2");
|
var player = Locator.GetPlayerBody().transform.Find("Traveller_HEA_Player_v2");
|
||||||
if (isLocalPlayer) {
|
if (isLocalPlayer) {
|
||||||
localInstance = this;
|
localInstance = this;
|
||||||
@ -25,9 +26,6 @@ namespace QSB {
|
|||||||
_body = Instantiate(player);
|
_body = Instantiate(player);
|
||||||
_body.GetComponent<PlayerAnimController>().enabled = false;
|
_body.GetComponent<PlayerAnimController>().enabled = false;
|
||||||
_body.Find("player_mesh_noSuit:Traveller_HEA_Player/player_mesh_noSuit:Player_Head").gameObject.layer = 0;
|
_body.Find("player_mesh_noSuit:Traveller_HEA_Player/player_mesh_noSuit:Player_Head").gameObject.layer = 0;
|
||||||
_body.parent = transform;
|
|
||||||
_body.localPosition = Vector3.zero;
|
|
||||||
_body.localRotation = Quaternion.identity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's dumb that this is here, should be somewhere else.
|
// It's dumb that this is here, should be somewhere else.
|
||||||
@ -65,7 +63,7 @@ namespace QSB {
|
|||||||
transform.position = sectorTransform.InverseTransformPoint(_body.position);
|
transform.position = sectorTransform.InverseTransformPoint(_body.position);
|
||||||
transform.rotation = sectorTransform.InverseTransformRotation(_body.rotation);
|
transform.rotation = sectorTransform.InverseTransformRotation(_body.rotation);
|
||||||
} else {
|
} else {
|
||||||
//var lerpPosition = Vector3.Lerp(_body.position, sectorTransform.TransformPoint(transform.position), _smoothSpeed * Time.deltaTime);
|
_body.parent = sectorTransform;
|
||||||
_body.position = sectorTransform.TransformPoint(transform.position);
|
_body.position = sectorTransform.TransformPoint(transform.position);
|
||||||
_body.rotation = sectorTransform.rotation * transform.rotation;
|
_body.rotation = sectorTransform.rotation * transform.rotation;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user