I set camera to follow player only x axis
but when I set camera, player stopped moving
(but there is a change in the x-axis)
Here’s my player movement code & camera follow code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraMove : MonoBehaviour
{
public Transform target;
// Update is called once per frame
void Update()
{
transform.position = new Vector3(target.position.x, transform.position.y,-10);
}
}