Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Sly on August 19, 2014, 09:23:47 AM

Title: Collision Event: What's needed to detect collision [SOLVED]
Post by: Sly on August 19, 2014, 09:23:47 AM
Hello,

I always have some trouble to understand how Collision Event action work.

I know my gameobject needs Rigidbody component for detect collision. But I'm always having problem to understand different option:

-Using gravity: it works, the detection is correct.
-Using Kinematic: it's not working. Why?
-Having a Box collider: it seems to prevent collision detection sometime.
-I'm only setting rigidbody on my object and it still detect object without rigidbody...

I really don't understand the rules of this action. Can someone explain me what it needs to work correctly? Which component? Which component to avoid? Am I oblige to use gravity on my object to make it work?

I'm a little bit confuse right now  ???
Title: Re: Collision Event: What's needed to detect collision
Post by: Lane on August 19, 2014, 09:39:51 AM
Collision is filtered by layers and is based on Physics, so entities require a rigidbody to be detected. For instance OnCollisionEnter is called when the specified rigidbody touches another.

Kinematic (http://docs.unity3d.com/ScriptReference/Rigidbody-isKinematic.html) makes the rigidbody basically ignore physics inputs. It has unlimited mass, sort of.

The type of collider makes no difference, Box is the cheapest (most efficient) and Mesh is/can be the most expensive to use.

Triggers work differently, maybe thats what you're looking for?
Title: Re: Collision Event: What's needed to detect collision
Post by: Sly on August 19, 2014, 05:08:56 PM
Ah thanks for all this explanations!
It's help a lot to understand how it's work!

And I just notice, it's better to use Collision detection set as "Continuous Dynamic", because sometime I had some weird collision event.

My last point for this subject is how I can detect a collision with an other character with the same tag, without taking care of the owner?
Because right now I'm trying to detect collision with the tag "enemy" but my owner has this same tag.
Is there a way to ignore ourself?
Title: Re: Collision Event: What's needed to detect collision
Post by: Sly on August 23, 2014, 07:06:57 PM
Ok, I got it. I add a bug in my scene.

Anyway thanks for the answer and all the info!