- Home /
(Roll a ball) The camera for the ball doesn't follow the ball.
I followed the roll-a-ball tutorial, and after scripting for the camera to follow the ball without rotating on the x axis with it. I did as the tutorial said and put the player in the "box" called player in the inspector of "main camera". When I hit play the camera literaly did not move what-so-ever, I redid my scripting and tired everything but when i hit play and moved the ball the camera still didnt move. Help pls
Answer by timrieder · Feb 14, 2017 at 06:34 AM
@AndrewLackey_97, I had the same issue so I added a logging statement to LateUpdate():
void LateUpdate () {
Debug.Log ("LateUpdate() here");
}
Initially, I accidentally named it LastUpdate() - so that's an issue right there. I compared the name again and saw it was wrong and fixed it. I selected the console and looked at it during game play - nothing was being printed. I checked that the Player was in the script's Player box in the inspector and it was. Oddly enough, when I looked at the Main Camera, the camera component was compressed/minimized (arrow was facing right). I expanded that and my camera preview popped up. I hit play again and it worked. I tried to get this to fail again, but I was unable to break it. Hope that helps.
Your answer
Follow this Question
Related Questions
swap between 3 gameobjects mid game 0 Answers
Camera Follow Player using a path 0 Answers
Unity 2D Position Issues 0 Answers
player goes crazy when using this, help! 0 Answers
Can you make a GUI.Box follow a player's position?(SOLVED) 7 Answers