Hello,
I’m quite new with Unity and I’m trying to set up a simple system.
I’ve got a cube which can fly into a tunnel composed of walls (plans).
Plans and cube both have box colliders.
Cube collider istrigger is true.
Cube has also a rigidbody, iskinematic = true.
Some balls are spawning in front of the cube and I can change their color by hitting them with the cube.
Basically I would like to allow the cube to hit the balls but I don’t want him to pass through the walls.
At the moment I almost succeed to do that but when the cube is hitting a wall, it’s just going everywhere, I’m completely losing control on it.
This can be done quite easily by assigning different layers to the balls, walls and cube, then using the Layer Collision Matrix found in Project Settings → Physics, and unchecking the objects you don’t want to be able to collide.
Thanks a lot.
I just checked what you linked but it seems that I’ll be able to manage collisions between objects.
I guess that I’ll still have the problem which the cube spin and go everywhere after a wall collision.
Maybe I misunderstood something