Playable demo build (no airship)
This commit is contained in:
@@ -8,11 +8,17 @@ namespace Scampz.GameJam
|
||||
private Vector3 cameraOffset;
|
||||
[SerializeField]
|
||||
private float _cameraYPosition = 45f;
|
||||
[SerializeField]
|
||||
private float _smoothTime = 0.3f;
|
||||
|
||||
private void FixedUpdate()
|
||||
private Vector3 velocity = Vector3.zero;
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
var player = GameObject.FindGameObjectWithTag("Player");
|
||||
|
||||
var lockedInYPosition = new Vector3(player.transform.position.x - cameraOffset.x, _cameraYPosition, player.transform.position.z - cameraOffset.z);
|
||||
Vector3.SmoothDamp(transform.position, lockedInYPosition, ref velocity, _smoothTime);
|
||||
transform.position = lockedInYPosition;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ namespace Scampz.GameJam
|
||||
{
|
||||
[SerializeField]
|
||||
private float speed;
|
||||
[SerializeField]
|
||||
private Transform targetObject;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user