playMaker

Author Topic: Trigger Enter / Collision Event works only with Character Controller?  (Read 1854 times)

WolframK

  • Playmaker Newbie
  • *
  • Posts: 4
Hi Friends,
very strange thing. I want to have a trigger event (or collision event) in Playmaker.



Very simple. If the right cube intersects with the left one, the trigger event shall be fired.
From past projects (it's been a while that I had Unity open) I remember it was as simple as this. The right cube needs "is trigger".

But this setup isn't working. ONLY, if I add the Character Controller component to the left cube (with FSM on it), then the trigger is fired.

Same applies for Collision Event by the way.

I don't want to have any user controlled movement here, so that's why I actually didn't intend to have a character controller on either of the test cubes. In the end I want to check if a neighbour cube has a certain state / color / attribute to react on this.
Only by pure conincident I tested the thing with the Character Controller and than it worked.

Is somebody aware of this? Or did I do something wrong?

Thanks for your help!
Best
Wolfram

NotCorvus

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Trigger Enter / Collision Event works only with Character Controller?
« Reply #1 on: September 11, 2021, 11:43:52 AM »
Hi, you need to add the "collide tag" as the same as the tag of the object that will enter the trigger, if you set the tag to "Player" it will only interact with objects tagged as Player

WolframK

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Trigger Enter / Collision Event works only with Character Controller?
« Reply #2 on: September 11, 2021, 01:03:23 PM »
Thanks!
But I've set the collide tag to nothing specific (meaning everything). And even if I set it to a specific tag (which I created especially for this), nothing happens - until I add a Character Controller component to it.
That's, what is so strange about it, and I'd like to understand why it doesn't work without this Character Controller Component.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Trigger Enter / Collision Event works only with Character Controller?
« Reply #3 on: September 11, 2021, 02:38:01 PM »
Hi.
At least 1 of the overlapping objects needs a rigidbody(2D)

WolframK

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Trigger Enter / Collision Event works only with Character Controller?
« Reply #4 on: September 11, 2021, 03:47:06 PM »
With (3D) rigid body (2D is only possible with 2D projects) my cube starts floating away. I really need just a collision detection, and it DOES work if ) add a character controller. I just don't get it why this is needed, since a Char.Ctrl. seems to just add another (spherical) collider. And I do have a box collider already.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Trigger Enter / Collision Event works only with Character Controller?
« Reply #5 on: September 12, 2021, 06:44:12 AM »
Hi.
yes 2d is for 2d detection only.

you have settings on the rigidbody where you can set the object for example kinematic or static.

here is some info on Character Controller VS Rigidbody

WolframK

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Trigger Enter / Collision Event works only with Character Controller?
« Reply #6 on: September 13, 2021, 01:16:35 AM »
Thanks, that helped a lot!  :)