playMaker

Author Topic: Collision Event  (Read 2182 times)

Nog

  • Playmaker Newbie
  • *
  • Posts: 47
Collision Event
« on: August 06, 2016, 05:14:51 PM »
Hello,

The Collision Event action never wants to work. In fact, I have tried to get it to work in the past, and I have never been able to get it to function.

I have a rigidbody, character controller, and a box collider attached to the player and a box collider attached to a plane. When the player touches the plane, the action never fires off the event. It does work when I change Collision from On Collision Enter to On Controller Collider Hit, but I would like to be able to identify when the player enters and exits a collider which On Controller Collider Hit does not allow.

I have looked at other topics on collision detection, but they all recommend using the Trigger Event instead of Collision Event. Is there a way to get the Collision Event to work with the setup I have suggested?

Nog

  • Playmaker Newbie
  • *
  • Posts: 47
Re: Collision Event
« Reply #1 on: August 07, 2016, 01:49:10 AM »
OK, I figured it out.

1. Attach a Rigidbody and a Collider to the object with the FSM on it (this would be the player). A Capsule Collider seems to work best. A box seems to make the character hang on the wall when moving into it.
2. Attach a collider to the object that will trigger the event (in this case a plane).
3. Uncheck use gravity and freeze the position and rotation of the Rigidbody's constraints.
4. Tag the object that will trigger the event (in this case a plane or a wall tagged Wall) and make sure that the collider tag is selected in the Collision Event action.

That seems to do the trick.