I am assuming if I don't access the contactPionts and relativeVelocity properties of the Collision class there's not much of a difference?
(as each of them are going to be a function call that cost some heavy calculation...)
The second one is low performance, because the Unity3d engine doesn't need to do a lot of calculations for you in order to provide the Collision parameter :)
Thank you very much for helping!! I didn't know that you could omit the entire parameter. O.o|| But does that mean once the collision parameter is included, everything must be calculated and at maximum cost? Even though all I need is just the collision.gameObject.name... Because that's 99% what I need to know, the object that is colliding with....
I know this is an older thread but I wanted to add you can do a lot for performance by isolating the layers of objects that will collide by setting up those relationships in the Edit->Project Settings->Physics menu. This will minimize the noise you're getting if you're only really looking for specific physics collisions.
If all you need to know is what the other object was you can make one or both of them Triggers and use OnTriggerEnter(Collider). You can use the Collider to get at the game object that’s doing the colliding with the trigger.
Thank you very much for helping!! I didn't know that you could omit the entire parameter. O.o|| But does that mean once the collision parameter is included, everything must be calculated and at maximum cost? Even though all I need is just the collision.gameObject.name... Because that's 99% what I need to know, the object that is colliding with....
– anon29094149Unfortunately yes :(
– SkjalgI know this is an older thread but I wanted to add you can do a lot for performance by isolating the layers of objects that will collide by setting up those relationships in the Edit->Project Settings->Physics menu. This will minimize the noise you're getting if you're only really looking for specific physics collisions.
– burtonposey_1