Two Colliders in One GameObject
Hey, i have a box that has 1 box collider, this box collider is used so the player can drag this box, and this box will collide with other objects, so basically the player changes the box position, and hit it with a ball.
But i want to make one collider to the movement and one collider to "collision".
So i can make the movement collider bigger and it will be easier for the player.
Thanks
What exactly is it that you need help with? Adding two colliders to one object, or a script so the player can drag the box around?
I have the script that the guy can move, but i want to have a bigger collider so the player can drag the box without pressing just IN the box. But if i make the collider bigger, the ball that hits this box, will hit in this collider thats too big.
So i need one collider big, so the player can press outside the box and mode the box, and a normal size collider just being a collider.
Thanks again
Answer by itsharshdeep · Feb 07, 2016 at 05:18 AM
Hi
I think that will be fine if you place 2 collider one for each functionality. But I have one question that how you will distinguish with one script on a single gameObject that 'A' collider is for touch and 'B' is for collision detection ...???
So I think you need to create an empty child gameObject which either detect collision and another one will be determining touch movement.
Hope I answered correctly ;)
oh, so I would need to create like a copy of the object and make it a child, and then in this child i put one of the scripts (for example the mouse drag one), and i make this one a big collider, and in the normal one i just leave the way that it is.
I will try that, thank you very much