Files
old-game/Assets/CameraMovement.cs

25 lines
537 B
C#
Raw Permalink Normal View History

2020-01-11 07:32:13 +01:00
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;
}
}