playMaker

Author Topic: [SOLVED] Collision > basic fundamentals? (chart inside)  (Read 4174 times)

amaranth

  • Full Member
  • ***
  • Posts: 172
[SOLVED] Collision > basic fundamentals? (chart inside)
« on: April 30, 2012, 02:35:54 PM »
I'm struggling with the rules of collision. If someone who knows them inside and out could take a look at the chart below and help shed some light on what goes where, I'd much appreciate it.

Acronyms to keep things short:
CC = Character Collider
BC = Box Collider (trigger OFF)
T = Box Collider (trigger ON)

Collision cases:
CC hits CC = [Only works when I use Ex Sprite Script with Collision Type = On. Not sure how to do this w/o ex2D].
CC hits T = Trigger Event
CC hits BC = [On CC, BC cannot hit CC] Collision Event > On Controller Collider Hit

T hits T = ??
T hits CC = ??
T hits BC = ??

BC hits BC = Collision Event
BC hits CC = Collision Event (BC must "fall" into CC. If BC is moving and CC hits from side, this will not register)
BC hits CC = ?? (BC isn't falling, but CC hits it)
BC hits T = Trigger Event

From what I'm seeing, the above scenarios make it very difficult to use one set of actions for one object. For example, how would you use one FSM for an object that moves 50% of the time and is at rest 50% of the time? Anything that hits the object needs to be recorded inside the object, not outside in another object. If I add the logic for the object in the object and everything it collides with, this would be incredibly messy.

Is there a way to call a collision for object X when infact object Y collided with object X?
« Last Edit: May 01, 2012, 01:50:44 AM by Alex Chouls »

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Collision > basic fundamentals? (chart inside)
« Reply #1 on: April 30, 2012, 03:36:22 PM »
Any time a object with a collider is hit and has itself set to "trigger on" it will fire a "trigger event"

On trigger enter (when they first touch)
On trigger stay (when one in inside the others volume)
On trigger exit (when the character leaves the trigger volume)

If a trigger is ON.... the object will be able to pass through it and will not block its movement.

I believe Triggers hitting other triggers does nothing.

so to answer your question

T hits T = nothing
T hits CC = trigger event is called
T hits BC = trigger event is called.




amaranth

  • Full Member
  • ***
  • Posts: 172
Re: Collision > basic fundamentals? (chart inside)
« Reply #2 on: April 30, 2012, 03:41:31 PM »
@justifun, that's not quite what I'm asking, but I agree. I've updated my post. Perhaps it makes more sense now.


justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Collision > basic fundamentals? (chart inside)
« Reply #3 on: April 30, 2012, 03:44:31 PM »
Can you provide an example situation where your getting hung up?  I'm still not 100% following what you mean.

You might be getting into needing to set tags on your objects and in the collision event action, choosing which objects are colliding and when so that they arn't colliding with everything.... is that what you mean?

https://hutonggames.fogbugz.com/default.asp?W30


amaranth

  • Full Member
  • ***
  • Posts: 172
Re: Collision > basic fundamentals? (chart inside)
« Reply #4 on: April 30, 2012, 04:11:15 PM »
I've already look and memorized those docs. My collisions are very hit and miss. Some work, some don't. I've been testing them for over a month now and the Unity collision system is about to make me break something.


amaranth

  • Full Member
  • ***
  • Posts: 172
Re: Collision > basic fundamentals? (chart inside)
« Reply #5 on: April 30, 2012, 07:54:52 PM »
By George, you're right! Tags did the trick! I was using them here and there, but not consistently. Now that everything has a tag, things are running much smoother. I'll clean up my post soon w/clear instructions for anyone else who gets stuck. :)

Still, I've gotta gripe that the Unity collision system seems so odd to me. Lots of quirks.