fix: rotation, smooth camera, ship portal collider, obstacle block collider, player rigid body detection, dynamic ground (#54)

This commit is contained in:
2025-04-06 17:24:10 +02:00
committed by GitHub
parent be5ea1e60a
commit 53af80411f
16 changed files with 222 additions and 187 deletions

View File

@ -5,6 +5,7 @@ public class PlayerCamera : MonoBehaviour
public GameObject playerObject;
public float normalMinYFollow = 2.0f;
public float shipMinYFollow = 6.0f;
public float smoothSpeed = 5.0f;
private float initialY;
private void Start()
@ -28,6 +29,8 @@ public class PlayerCamera : MonoBehaviour
targetY = playerObject.transform.position.y;
}
transform.position = new Vector3(playerObject.transform.position.x, targetY, transform.position.z);
float newY = Mathf.Lerp(transform.position.y, targetY, smoothSpeed * Time.deltaTime);
transform.position = new Vector3(playerObject.transform.position.x, newY, transform.position.z);
}
}