Initial commit
This commit is contained in:
24
Assets/CameraMovement.cs
Normal file
24
Assets/CameraMovement.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraMovement : MonoBehaviour
|
||||
{
|
||||
public Vector3 myPos;
|
||||
public Transform myPlayer;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Vector3 futurePosition = new Vector3(myPlayer.position.x + myPos.x, transform.position.y , myPlayer.position.z + myPos.z);
|
||||
|
||||
transform.position = futurePosition;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user