playMaker

Author Topic: Physics.IgnoreCollision  (Read 7115 times)

Gevarre

  • Playmaker Newbie
  • *
  • Posts: 49
Physics.IgnoreCollision
« on: June 15, 2013, 04:41:14 PM »
In Unity scripting, when the player instantiates a projectile, I use Physics.IgnoreCollision to get the projectile to ignore the player. I don't see any equivalent in Playmaker.

Here is the full script from the scripting docs:
Code: [Select]
// Instantiate a bullet and make it ignore collisions with this object.
    var bulletPrefab : Transform;
    function Start () {
        var bullet = Instantiate(bulletPrefab) as Transform;
        Physics.IgnoreCollision(bullet.collider, collider);
    }

Any chance we can get an action made for this? It's kind of tricky to do it mixing Playmaker and scripting in this case because it needs to be called immediately after instantiation.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15591
  • Official Playmaker Support
Re: Physics.IgnoreCollision
« Reply #1 on: June 17, 2013, 06:38:04 AM »
Hi,

 A neat was around this is to use physics layer and everything fired by the player is set to a different physics layer, they will ignore each other then and you don't need to care about this within your game logic.

 Would that do for your case? If not I'll do a custom action :)

bye,

 Jean

Gevarre

  • Playmaker Newbie
  • *
  • Posts: 49
Re: Physics.IgnoreCollision
« Reply #2 on: June 17, 2013, 12:47:17 PM »
Unfortunately, that won't work. I need the projectile to ignore the collision of the player that shot it, but if I put it on a layer so that ignores "player" collisions, then it won't hit anyone.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15591
  • Official Playmaker Support
Re: Physics.IgnoreCollision
« Reply #3 on: June 19, 2013, 02:08:49 AM »
Hi,

 Are you in a multi user environment? else your ennemies should be on a different layer.

bye,

 Jean

Gevarre

  • Playmaker Newbie
  • *
  • Posts: 49
Re: Physics.IgnoreCollision
« Reply #4 on: June 19, 2013, 02:55:48 AM »
Yes, it's a multiplayer game, so layers don't help. Everyone, by necessity, is on the same layer.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15591
  • Official Playmaker Support
Re: Physics.IgnoreCollision
« Reply #5 on: June 19, 2013, 03:27:15 AM »