Hello guys, Just wondering if it is possible to change a box collider so that the result is dependant on where player collides?
Looked through google, but figure you guys would be able to point me straight to some reading material!
Hello guys, Just wondering if it is possible to change a box collider so that the result is dependant on where player collides?
Looked through google, but figure you guys would be able to point me straight to some reading material!
make six child objects. Each one has its own box collider with a very low thickness. Arrange them to make a box. Now each side is a different collider, and each collider can be programmed to send a different signal to the script. Hope this helps.
I think it is definitely possible but will involve some math which I wouldn’t be able to explain. First you would need to know the center of the collider which can be found through the colliders bounds property. You’ll also need to know the orientation of the collider but I’m not sure how that is defined. The six planes need to then be defined for the collider. Once you have these defined you can use the contact points from the Collision class to determine which plane the point lies in. I’ll probably research into this myself because it sounds as if it could be useful.