- Home /
Unity Collison Problem
Hi, I'm making a simple physics puzzle game where you rotate the level clockwise and anti clockwise to navigate a ball to a target through a maze like puzzle. However the ball is not colliding correctly with the maze walls.
The maze is made up of cubes that are stretched into shape. They are all a child of an empty game object placed in the centre of the level and they all rotate around that and that is how the ball moves. Sometimes the collisions are ok but then out of nowhere it just falls through. Each stretched cube has its own box collider.
Has anybody any idea how to fix this?
At least, you need a kinematic RigidBody for your parent object because the colliders are all moving (rotating in your case).
I had also tried that using a cube as a back board. When I get home Il post a video and more details to show the problem.
Answer by JamieOFlanagan · Apr 26, 2012 at 06:45 PM
So I took a video on my phone, apologies for poor quality but you will see the problem.
http://www.youtube.com/watch?v=h5fO2YXthg4&feature=youtu.be
In this version the blue backboard is the parent object and everything rotating with it is a child of that object. They are all verticle and gravity is being used for the ball to move.
Any help would be great.
Here is the code attached to the parent object
var speed : float;
function Update ()
{
transform.rotation.eulerAngles += Vector3.back Input.GetAxis("Horizontal") speed;
}
Your answer
Follow this Question
Related Questions
Collision detection not working 1 Answer
OnCollisionEnter not working 1 Answer
Collision Checking 1 Answer
Collision issue 1 Answer