Answer the question
In order to leave comments, you need to log in
How to make the camera move behind the object?
There is a ball that spins in all directions and you need to make sure that the camera follows the ball, but does not spin.
Here is the ball code
using UnityEngine;
public class PlayerController : MonoBehaviour
{
private Rigidbody rigidbody;
private void Start()
{
Cursor.visible = false;
rigidbody = gameObject.GetComponent<Rigidbody>();
}
private void Update()
{
if (Input.GetKey(KeyCode.W))
{
rigidbody.AddForce(Vector3.forward * 10f);
}
}
}
Answer the question
In order to leave comments, you need to log in
Hello, I think this is what you need, just indicate the coordinates of the object and that's it. https://docs.unity3d.com/ScriptReference/Quaternio...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question