mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-10 22:20:40 +02:00
fix: rotation, smooth camera, ship portal collider, obstacle block collider, player rigid body detection, dynamic ground (#54)
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user