Collision issue, Plz help
Hi Could someone with a bit more coding knowledge than me please tell me if this could have an issue with the collision boxes and trigger boxes in Unity. Coz at the moment ether is being detected by Unity. I've tried putting rigid body on the two things I wanted them to collide into but that's not worked and lots of other things too with no success.
If you do know how to fix it could you plz show/tell me howt hat would be much appreciated.
Thanks
Code:
private void UpdateOrientationAndPosition() %|1716369182_1|% %|-100239312_2|% %|-1559585296_3|% %|158838615_4|% %|-49892437_4|% %|-278998187_6|% %|1555532067_7|% %|-42286241_1|% %|-1730490008_6|% m_initialAvatarRotation * Quaternion.AngleAxis(-SmoothedInput.y * m_spaceship.MaxBankAngleOnTurn, Vector3.forward), %|-983437173_11|% %|-1506266632_8|%
Or: http://pastebin.com/RUCruuk0
Answer by srivello · Nov 02, 2016 at 11:59 AM
Hi trooper1489,
OnTriggerEnter(Collider collider), OnCollisionEnter(Collision collision), and other related call backs are super useful.
In general if you want the objects NOT to overlap, use Collision. Otherwise use Trigger.
Here is a sample project that shows both and you can examine the differences between them. https://dl.dropboxusercontent.com/u/5981704/UnityForum/BasicCollisionDemo.zip
Enjoy!
-Sam