playMaker

Author Topic: Collision Event: What's needed to detect collision [SOLVED]  (Read 2505 times)

Sly

  • Full Member
  • ***
  • Posts: 123
Collision Event: What's needed to detect collision [SOLVED]
« 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  ???
« Last Edit: August 23, 2014, 09:43:13 PM by Sly »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Collision Event: What's needed to detect collision
« Reply #1 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 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?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Sly

  • Full Member
  • ***
  • Posts: 123
Re: Collision Event: What's needed to detect collision
« Reply #2 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?
« Last Edit: August 23, 2014, 07:06:12 PM by Sly »

Sly

  • Full Member
  • ***
  • Posts: 123
Re: Collision Event: What's needed to detect collision
« Reply #3 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!
« Last Edit: August 23, 2014, 09:42:50 PM by Sly »