playMaker

Author Topic: [Solved] Triggers, colliders, projectiles, oh my!  (Read 2790 times)

createasaurus

  • Full Member
  • ***
  • Posts: 146
[Solved] Triggers, colliders, projectiles, oh my!
« on: December 23, 2015, 11:47:36 AM »
I think I am missing the basic idea on how to use triggers or colliders with projectiles.

I have a projectile that I am moving with Translate.
I use Trigger Event on the Projectile, with Collide Tag as Player, to Send Event - this works fine, for the player.

However, for the walls, it just won't work - the projectiles just go right through.
How do I set up the walls?

For the walls:  I've tried Trigger Event, set as trigger, not as trigger, with and without a collider, untagged, with a tag, using the Collision Event action, even using different 3d geometry.  But I'm making no headway.  Thoughts?

Thank you!
« Last Edit: December 24, 2015, 11:27:34 AM by createasaurus »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Triggers, colliders, projectiles, oh my!
« Reply #1 on: December 23, 2015, 02:25:43 PM »
What do you want the projectiles to do to the walls?

If you just want them to bounce off- Instead of using translate you can use Add Force and add a rigid body tag to the projectile- then on the walls all you need is a collider and the projectiles will be stopped by the walls
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Triggers, colliders, projectiles, oh my!
« Reply #2 on: December 24, 2015, 05:23:06 AM »
Hi mdotstrange, thanks for the reply.

I would like the projectiles to simply "blip out" when they hit the wall. - in reality I'd have them teleporting back into the cannon and fire again.

This game is a little fantasy, these are like fire magic energy, so bouncing away wouldn't quite work.  But also, as it currently stands, passing through the wall isn't best either.

I think I'm simply having trouble understanding basic usage of triggers / colliders...  for instance:  Why is this working perfect with the Player (Tagged as Player)...  but not with walls?  And I even built a new 3D test wall, tagged it as untagged, tagged it as "wall."

Still tinkering... but stumped.
Thoughts?

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Triggers, colliders, projectiles, oh my!
« Reply #3 on: December 24, 2015, 06:36:08 AM »
its possible that its going through the wall between frames so the collision doesn't trigger

I've tried getting around this by double checking collisions with raycasts and different rigidbody setups (the collision types make a big difference), but there always seems to be a situation (like the small corners of walls) where things still clip through

you'll find a lot of discussions on this if you google it outside of playmaker

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Triggers, colliders, projectiles, oh my!
« Reply #4 on: December 24, 2015, 11:27:15 AM »
Hi terri,
Cool.  This gives me a good place to start troubleshooting.
Thank you!

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: [Solved] Triggers, colliders, projectiles, oh my!
« Reply #5 on: December 24, 2015, 06:17:35 PM »
Sometimes trigger events don't work until you add a rigid body component set to "IsKinematic"- I don't know why but its worth a try.
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!