- Home /
Why does the screen start spinning?
I made a game where you control a ball and try to collect all the things and get over obstacles. The obstacles are basically scaled cubes. The thing is that whenever the player touches the sides of the cubes, the whole screen starts spinning and the controls get messed up too. The screen only starts spinning when the player touches the side of a cube. When it is on the cube, it is perfectly fine. The screen doesn't spin when the player touches the bottom or the top. Can somebody tell me what is going on and how to fix it? Help greatly appreciated!
Probably an issue with how you parented the camera. But don't know for sure, need more information, pictures, video, anything that might help diagnose the problem.
@donutLaserDev I had the player as the parent of the camera. I added a script to make the camera follow the camera. But note that the ball/player does not roll but only translates along the horizontal and vertical axis.
Does the ball have a dynamic rigidbody attached to it?
Which one? I have a script for the ball, the camera, and some obstacles.
Answer by hawksandwichgames · May 30, 2018 at 02:24 PM
I'm about 100% sure it's because the ball is a parent of the camera. This becomes a problem when the ball itself rotates (probably initiated by hitting the side of an obstacle.) If the ball ever rotates and the camera is a child of that ball, the screen will go crazy. The way to test if this is the problem is by making sure the ball never rotates (do this by constraining rotation on the RigidBody of the ball and by making sure there's no code that causes it to rotate.)
Answer by anthot4 · May 29, 2018 at 02:48 PM
@eatsomechicken it is proberly a problem with how you have parented the camera.
I put the player as the parent of the camera. I added a script to make the camera follow the player.
Your answer
Follow this Question
Related Questions
Camera Collision Not Working 0 Answers
Camera collision 2 Answers
Camera bounce/collision 1 Answer