I’m new to unity, I’m trying to figure out how to do the rolling ball tutorial game to start off, and the next lesson I’m learning is how to make the camera follow the ball. I put the camera as a “child” of the player object (the ball) and when I hit play to see if the camera followed my ball, I found out that it did… way too well. The camera rolls like the ball does so the entire camera screen is rotating and spinning and frankly makes me feel a bit sick watching it. Is this because in my script the ball rolls, so making the camera a child of the ball makes the camera roll too? I can’t figure out how to fix this nonsense and I need to to continue learning unity
here is the tutorial i’m using: Unity Connect
Here is my script attached to my player: using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start (){
rb = GetComponent<Rigidbody> ();
}
void FixedUpdate () {
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
}