Ok so, as first I’m being sorry for my bad english skills. Back to the issue, I was trying to make a “Player Follow” camera script, and since my camera was rotating around the player object (The player is a sphere, so it turns a lot).
The code is this:
public class FollowPlayer : MonoBehaviour
{
public Transform camTarget;
public float pLerp = .01f;
public float rLerp = .02f;
public GameObject PlayerSphere;
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.position = Vector3.Lerp(transform.position, camTarget.position, pLerp);
transform.rotation = Quaternion.Lerp(transform.rotation, camTarget.rotation, rLerp);
transform.rotation = new Quaternion(0, transform.rotation.x, transform.rotation.y, transform.rotation.z);
transform.position = new Vector3(transform.position, transform.position, transform.position);
}
}
The part giving me this error is the last string (transform.position = new Vector3(transform.position, transform.position, transform.position);). I would really appreciate any help about this string, I really cannot understand what is the problem here.