- Home /
Question by
Chipsmoony · Nov 23, 2016 at 07:34 AM ·
camerascripting problem
I'm watching the Roll a Ball tutorial part 3 (part about the camera following the ball), and I put in all the code the speaker said to put in, but the camera isnt following the ball?
Here's my code:
using UnityEngine; using System.Collections; public class CameraController : MonoBehaviour { public GameObject player; private Vector3 offset; void Start() { offset = transform.position - player.transform.position; } void LateUpdate() { transform.position = player.transform.position + offset; } }
Comment