playMaker

Author Topic: Help, character controllers are colliding, but event is not being triggered  (Read 13383 times)

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
I have 2 objects, the PC and the NPC, both objects are using a Character Controller

when the PC hits the NPC, the collision is not being detected, well the NPC isn't going through the PC, but the event that's supposed to be triggered isn't being triggered

I'm using the Collision event action, and for collision I'm using On Controller Collider Hit

it's like I'm saying when object hits the floor, destroy object, but object is only hitting the floor without getting destroyed

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

-- Have you messed with physics layer settings?

-- Are you really using "Colliders" everwhere, not "triggers", there is a difference, both are collider components, so it can get confusing.

-- try to use the global event "ON COLLIDER ENTER", if that works, then it's your action set up that is not correctly set.

bye,

Jean

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
Quote
Have you messed with physics layer settings?
don't think so, where do I find the physics layer settings?

Quote
Are you really using "Colliders"
I'm using a Character Controller, and as far as I know, it comes with it's own collider, but not the option to turn it to trigger

Quote
try to use the global event
I'm asuming you mean in the Collision event action, in collision
I changed from "On Controller Collider Hit" to "ON COLLIDER ENTER", I'm still getting nothing

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Try adding rigidbodies to each and making them Kinematic.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
I guess rigidbodies could work, but my setup is meant to work with a character controller

If I switch to rigidbodies, I'd have to retrace my steps and make many changes

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Make it kinematic and ignore gravity and see if it fixes the issue. You're not applying any physics forces so it shouldn't be any impact to your design.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
damn, yea, didn't work

thanks for trying

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Can you post a screenshot of the on collision event state?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
how do I add images here

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
never mind

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
The NPC Attacking tag is probably the problem.


The collision tags are meant for the collider shapes, the object that you have the collider on needs to be tagged "NPC Attacking", the tag option in the top of the inspector, left of the Layer selection drop down list. Also confirm that the object on the player that has the collider component is tagged "Player".


Generally I would just use the collider of the NPC, and in which case I dont know why it would ever be called NPC Attacking unless the NPC is constantly wailing a sword through the air.


I dont think the collision is ever happening, according to the engine.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
my NPC has a few states, it follow (tagged following), it gets into readying mode (tagged readying), and when it actually attacks, I used the tags to make it so that the PC can only be hurt when NPC is actually attacking

The PC is tagged "Player", and the Attacking tag is on the NPC, it switches tags depending on the state

anyway I'll give the tag idea a try, I'll also try Debug to see if collision is happening

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Help, character controllers are colliding, but event is not being triggered
« Reply #12 on: February 13, 2014, 03:26:13 PM »
Faced exact same problem. Has anyone found a solution?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Help, character controllers are colliding, but event is not being triggered
« Reply #13 on: February 13, 2014, 03:50:52 PM »
Faced exact same problem. Has anyone found a solution?

It looked like he was using Tags to define the state of the NPC for some reason and the colliders were not detecting the collision because the tags didn't match. Tags shouldn't really be used in that manner.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

billsclass

  • Playmaker Newbie
  • *
  • Posts: 11
I'm running in to the same issue. Once a Character Controller is added to an object, the collision events don't seem to work. I'm not sure if this is how Unity handles Character Controllers or if this is a PlayMaker.

Collisions Events work just fine in various scenarios including,
RidigBody vs RigidBody
RigidBody vs Collider (non RigidBody)
RigidBody falling on Character Controller Collider

Once a Character Controller is added to an object (with or without Rigid Body) Collision Events will not fire when initiated by the object with Character Controller.

Throw a RigidBody object at the object w/ Character Controller and you can get an event to fire.

System Event > Control Collider Hit seems to work, but there is not way to efficiently check continuously and filter by tag.

The only work around I've come with is to use Trigger Events instead of Collision Event. You will have to run into an object with Collider set to Trigger.

In the case of two objects with a Character Controller, you'll need a child object with a Collider set to Trigger to fire events.

Anyone else have a solution?

-AB