Attempt to get animation working
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam
|
||||
@@ -15,7 +16,7 @@ namespace Scampz.GameJam
|
||||
|
||||
private void Start()
|
||||
{
|
||||
cameraOffset = transform.position - targetObject.transform.position;
|
||||
//cameraOffset = transform.position - targetObject.transform.position;
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
@@ -24,6 +25,7 @@ namespace Scampz.GameJam
|
||||
transform.LookAt(targetObject);
|
||||
|
||||
var newPosition = targetObject.transform.position + cameraOffset;
|
||||
var absTransform = new Vector3(newPosition.x, Math.Abs(newPosition.y), newPosition.z);
|
||||
transform.position = Vector3.Slerp(transform.position, newPosition, smoothFactor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user