playMaker

Author Topic: Get Collision Info not getting contact point or even collider  (Read 7529 times)

vonpopov

  • Junior Playmaker
  • **
  • Posts: 98
Get Collision Info not getting contact point or even collider
Trigger is working well, so no matter with that, but i get nothing from :

Store collider (into an object var)
Get collider info (into a contact point/normal point) from the object var.

I took a look at this :
http://hutonggames.com/playmakerforum/index.php?topic=2439.0

But my collider, and my collided are both non kinematic.
So, i should miss something else

any idea ?

nb : basically my main purpose is to spawn an explosion (Fx_Prefabs) from a create object, but i need the position where to make it spawns, and i can't get it.


thanks you
« Last Edit: April 12, 2014, 02:24:19 PM by vonpopov »

billsclass

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Get Collision Info not getting contact point or even collider
« Reply #1 on: April 13, 2014, 06:52:18 PM »
Are you using a Character Controller Collider as one of the colliding objects?

vonpopov

  • Junior Playmaker
  • **
  • Posts: 98
Re: Get Collision Info not getting contact point or even collider
« Reply #2 on: April 14, 2014, 09:07:29 AM »
Are you using a Character Controller Collider as one of the colliding objects?

no. i am using both "box collider".
I am supposed to replace my box collider with a character controller on 1: the Bullet ? or on 2: the Target ?


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Get Collision Info not getting contact point or even collider
« Reply #3 on: April 14, 2014, 10:45:12 AM »
Could be a timing issue. Can you post a pic of the FSM(s)?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

vonpopov

  • Junior Playmaker
  • **
  • Posts: 98
Re: Get Collision Info not getting contact point or even collider
« Reply #4 on: April 14, 2014, 03:18:46 PM »
The bullet FSM :

(Wait 5 sec, then destroy self, if triggered get collision info, then collision data, then destroy)

The Target FSM :

(wait to be triggered, then destroy)


i tryed a character collider, box collider, whatever i tryed it does not work. collision is ok, my target and bullet disapear when hit, but i get no info about that ... :s

But maybe i am wrong, and i need the target to collect the info and spawn the explosion fx, not the bullet ? ... i assume this should be same problem, but tell me.
« Last Edit: April 14, 2014, 03:20:52 PM by vonpopov »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Get Collision Info not getting contact point or even collider
« Reply #5 on: April 14, 2014, 03:29:04 PM »
What does the Hit state look like? If you're using Get Collision Info then you don't need to store the collider on collision, might be other redundancies or something causing an issue?

::Edit
Actually, the target dummy object is blowing itself up immediately when its hit, so that might be an issue too. Try delaying that.
« Last Edit: April 14, 2014, 03:34:58 PM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

vonpopov

  • Junior Playmaker
  • **
  • Posts: 98
Re: Get Collision Info not getting contact point or even collider
« Reply #6 on: April 14, 2014, 05:16:14 PM »
What does the Hit state look like? If you're using Get Collision Info then you don't need to store the collider on collision, might be other redundancies or something causing an issue?

::Edit
Actually, the target dummy object is blowing itself up immediately when its hit, so that might be an issue too. Try delaying that.

i temporarly deactivated the self destruct state for both dummy and bullet. And guess what ... it works ! thank you. So now, i get the object name.

But i still have a problem. I tryed to get object name in order to get more info about the collision point throught "get collision info" but that did not work.

here is my process, please tell me if i am wrong.



regards


nb : i start feeling, this could be more simplier to spawn the explosion FX, as a child to the bullet, and make it "renderable" at collision trigger. could it be a better way ? better optimization ?
« Last Edit: April 14, 2014, 05:20:10 PM by vonpopov »

vonpopov

  • Junior Playmaker
  • **
  • Posts: 98
Re: Get Collision Info not getting contact point or even collider
« Reply #7 on: April 15, 2014, 08:25:44 AM »
It seems i have the exact same issue :

Hi

I'm sending a Collision Event to a Get Collision Info but I'm not getting any data at all after the Collision Event triggers. It could just be me but I'm using it in the same way I do to get Get Trigger/Raycast info and they work fine.

To give you more details, I'm using:

On Controller Collider Hit
With a Collide Tag

All I'm getting is 0,0,0 vectors for both Contact Point and Contact Normal.

Thanks

Mark

[Solved] it!

After looking through Unity's reference I found out that you need a non kinematic rigidbody on a character controller (moving via Move) to get the information.

I also had to use a Sphere Collider and use On Collision Enter. For some reason the collider on the Controller won't work for collisions.

Hope that helps someone, took me awhile to figure it out :(


But, i am already using :
1 Bullet : character controller + Sphere collider (trigger on)
2 Target : character controller + Sphere collider (trigger on)

I tryed to get the info from the bullet, and from the target, i tryed box collider, sphere collider, with or without character controller.

Bullet and Target are both non kinematic (use rigidbody), so i don't get why this is not working. Is still get no info about contact point/normal

any clue ?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Get Collision Info not getting contact point or even collider
« Reply #8 on: April 15, 2014, 08:44:59 AM »
Ah I see the problem. You cant use Trigger Event and Collision Info together.

Its either a Trigger or a Collision, when the Trigger fires it isn't storing Collision Info and vice versa.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

vonpopov

  • Junior Playmaker
  • **
  • Posts: 98
Re: Get Collision Info not getting contact point or even collider
« Reply #9 on: April 15, 2014, 10:15:01 AM »
Ah I see the problem. You cant use Trigger Event and Collision Info together.

Its either a Trigger or a Collision, when the Trigger fires it isn't storing Collision Info and vice versa.

Could you show me a FSM structure who store collision ?

Nb : for my purpose, i decided to change my way of doing it, now this is working using the center of the bullet for spawning explosion FX. But i am still curious to make a Store collision working.

thanks you

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Get Collision Info not getting contact point or even collider
« Reply #10 on: April 15, 2014, 10:17:14 AM »
Instead of Trigger Event simply use Collision Event and toggle "Is Trigger" off, for both objects collider components.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

vonpopov

  • Junior Playmaker
  • **
  • Posts: 98
Re: Get Collision Info not getting contact point or even collider
« Reply #11 on: April 15, 2014, 07:44:32 PM »
Instead of Trigger Event simply use Collision Event and toggle "Is Trigger" off, for both objects collider components.

Thanks you a lot !
:)