Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MarkD on April 24, 2014, 04:13:23 PM

Title: Get Collision Info Not Working[SOLVED]
Post by: MarkD on April 24, 2014, 04:13:23 PM
Hey everyone,

In my project, I have an object firing projectiles.  When it hits an object I want to store what that object is so that I can do a compare so that I can decide to do damage to it or not.

I've got three objects in my prototype:

However, when the projectile collides with the receiver object, I can see that in the projectile FSM that the game object variable (myTarget) isn't being set.

(http://CollisionInfo02.jpg)

I'm guessing that I'm not configuring something correctly with my objects rather than there being something incorrect in my FSM's, but I'll be damned if I can figure out what it is.

I have both objects set up with colliders and rigid body components.  Here's what the inspector panel looks like on both of them.

The Projectile:
(http://CollisionInfo01.jpg)


The Receiving "Hit" Object:
(http://CollisionInfo03.jpg)

Note:  I can clearly see the projectiles impacting the Receiver Object, but for some reason Get Collision Info is not capturing the Game Object as a variable.

Any ideas anyone?
Title: Re: Get Collision Info Not Working
Post by: Lane on April 24, 2014, 05:01:22 PM
You're firing FINISHED through those states. You must have a Collision Event in the Add Force state that is also firing FINISHED when there is a collision. Is that the case?

You can right click that "Collision" state and Add Breakpoint to pause the game whenever it enters that state. That would at least confirm the flow is working.
Title: Re: Get Collision Info Not Working
Post by: sebaslive on April 24, 2014, 05:11:07 PM
Seconded to collision event on Add force state. So it knows that when it collides it goes to that collision state. You can also right click on the collision state and select with a global event on collision.
Title: Re: Get Collision Info Not Working
Post by: MarkD on April 24, 2014, 09:53:45 PM
That was it!  I needed a Collision event!  Thanks guys!