#Colliders VS RigidBodies - When to use which?

1 messages · Page 1 of 1 (latest)

dusky fox
#

I'm going through some basic tutorials on Unity, and I'm reading about colliders. In reading I thought a good description for how colliders differ from rigid bodies is "Colliders are how GameObjects are able to interact with each other, RigidBodies are how GameObjects interact with physics" but that doesn't seem to be entirely the case.

I guess you can put a material property on a collider that dictates how it interacts with other colliders? I'm curious when you would use this over a physics interaction through RigidBodies.

#

So is a rigidbody for something that gets affected by gravity?

split folio
#

Rigidbodies is just the physics that unity has built in but a collider just collides with things, you usually want both

#

or do i understand it wrong

dusky fox
#

Say I have like a pachinko type game. A ball is dropped into a series of obstacles. The ball is obviously a rigidbody because I want gravity to pull it through all the obstacles, but the obstacles don't need to be rigidbodies, right?

split folio
#

No the obstacles would only need colliders

dusky fox
#

I'm not sure how the material property on a collider is supposed to be useful

split folio
#

Its for physics materials

#

Like friction and bouncyness

#

If you give the ball a physics material with bouncyness it bounces 👍

dusky fox
#

So I can have bounciness without a rigidbody?

split folio
#

No

dusky fox
#

This is what is confusing me

split folio
#

What exactly?

dusky fox
#

Oh, maybe I understand. The material property dictates how the ball would bounce off of this particular collider

#

Instead of in the ball checking what collider is being hit and applying forces, I give the collider object material properties that the ball uses to decide how it react?

split folio
#

yeah

#

do you have unity open right now?

dusky fox
#

No

split folio
#

Oh okay, i would give the advice to play around with those things in order to understand it better

dusky fox
#

Yeah, I'm going through some of the unity.learn tutorials and they are okay. I just wanted to make sure I was reading this correctly. It didn't really explain that the material dictates how physics objects specifically react to collision. Thanks for helping me clear that up though.