Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: SOMRH on April 01, 2015, 07:31:09 AM
-
Hi all,
I'm having a hard time understanding how the 2d Collision event works. In order to obtain 2d collision info from an enemy attack, I need to use the COLLISION ENTER 2D. If I use a local trigger, no collision is obtained.
Here's my problem. The COLLISION ENTER 2D event is triggered by all colliders. All of the objects that have colliders all have the 2d proxy script (marked in red).
How can I set it up so that I can still get the collision info from the enemy but have it so that the walls do not trigger the the FSM?
(http://i.imgur.com/RAPaHeo.png)
-
Hi,
If you have colliders as childs of a parent that also has a collider, then yes, the parent will received the trigger of the child too.
Is that the case or do I mis understand your setup?
Bye,
Jean
-
I meant that everything, including the walls are registering as a triggered event. For example, if I walk the player to a wall (tag:wall) and it collides, the FSM on the player fires a COLLISION 2D EVENT (a global event) even though I set the collide tag to "enemy damage."
If I attempt to use a local trigger, the collision works perfectly but I am unable to obtain any 2d collision info from the "enemy damage" tag.
-
Hi,
Ok, I see. I did not distribute these actions cause I wanted to wait for 1.8 and the new fsmEnum, but I guess it's ok. I have pushed them on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
so you'll have now two new actions working like their 3d counterpart. I suggest you get them via the Ecosystem, it's faster, but here's the links to the github if you need it.
Collision2dEvent (https://github.com/jeanfabre/PlayMakerCustomActions_U4/blob/master/Assets/PlayMaker%20Custom%20Actions/Physics%202d/Collision2dEvent.cs)
GetCollision2dInfo (https://github.com/jeanfabre/PlayMakerCustomActions_U4/blob/master/Assets/PlayMaker%20Custom%20Actions/Physics%202d/GetCollision2dInfo.cs)
so you can either keep receiving all collisions and use GetCollision2dInfo to filter out by tag or use Collision2dEvent in place of the global events and be notified just for your specified tags.
Bye,
Jean