add z-axis offset to the cameras

This commit is contained in:
jparent 2015-08-14 16:45:10 -04:00
parent 49470678d8
commit e71ce63d66
3 changed files with 4 additions and 1 deletions

View File

@ -90,6 +90,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
y: 25
offsetZ: -5
transitionDuration: .100000001
--- !u!124 &12432070
Behaviour:

View File

@ -90,6 +90,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
y: 25
offsetZ: -5
transitionDuration: .100000001
--- !u!124 &12404998
Behaviour:

View File

@ -5,6 +5,7 @@ public class SquadCamera : MonoBehaviour {
private Vector3 target;
public float y = 25f; // store the height value since it will never change
public float offsetZ = -5f;
public float transitionDuration = 2.5f;
@ -35,7 +36,7 @@ public class SquadCamera : MonoBehaviour {
float t = 0.0f;
Vector3 startingPos = transform.position;
Vector3 destination = new Vector3( target.x, y, target.z );
Vector3 destination = new Vector3( target.x, y, target.z + offsetZ); // add the offset
while (t < 1.0f) {