playMaker

Author Topic: Equipting an object with collider  (Read 1569 times)

fotiko

  • Playmaker Newbie
  • *
  • Posts: 3
Equipting an object with collider
« on: November 22, 2017, 10:43:16 AM »
I have a warrior. I want to be able to equipt a spear. Ok i ve created an empty at the hand when the player passes from the spear it becames a child of the empty.Perfect .
But!!! when the spear has nother collider except the one that is trigger it spawns it with an offset or worse it passes and pushes it without equpting it !!
whyyy?
Aim
to euipt the spear and by pressing mouse button to throw it. The second collider -the one not trigger is neccessary so that it hits something

Doh

  • Full Member
  • ***
  • Posts: 124
Re: Equipting an object with collider
« Reply #1 on: November 22, 2017, 11:40:19 AM »
Is there a rigidbody that forces one collider to push the other from its intended position?

I'm not sure I understood the issue correctly but if the answer to my question is yes, then I'd suggest either putting them on separate layers, then disabling the collisions between those two layers using the collision matrix (go to edit/project settings/tags and layers). Or you could simply set the collider used for the throw impact to disabled and then once thrown enable it, this could potentially cause issues if enabled quickly as it could still be in contact with the other collider.

If it were me I'd go the layers route.

fotiko

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Equipting an object with collider
« Reply #2 on: November 23, 2017, 05:38:43 PM »
Thank you . How can i disable and enable a collider with playmaker?
with layers wouldnt that mean that the weapn wouldnt collide with everything in other layers?

Doh

  • Full Member
  • ***
  • Posts: 124
Re: Equipting an object with collider
« Reply #3 on: November 23, 2017, 05:53:01 PM »
There is an "Enable Collider" action, if it's not included by default then it'll be on the Playmaker Ecosystem.

With the layer method though you can specify which layers collide with other layers, so you can make two new layers, one of the weapons and another for the other collider in question, this will allow you to just stop collisions between the two layers rather than every collider.

Hope that helps!

fotiko

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Equipting an object with collider
« Reply #4 on: November 25, 2017, 03:48:13 PM »
Nope that wouldnt work cause the trigger wouldnt be activated since the player and the weapon woul be on different layers. If my weapon was a gun that just shooted projectiles thhings would have been easy. Now i need a melee weapon and that meshes everything ...up
.I really need a video tutorial about equipting weapons with colliders
swords spears etch

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Equipting an object with collider
« Reply #5 on: November 25, 2017, 04:38:34 PM »
https://docs.unity3d.com/Manual/CollidersOverview.html

Check out the collision action matrix and use what you need.
Available for Playmaker work