playMaker

Author Topic: Align spawned particle system  (Read 1367 times)

ivam

  • Playmaker Newbie
  • *
  • Posts: 34
Align spawned particle system
« on: October 28, 2016, 03:31:18 PM »
Hey guys, iam working on something involving tanks and shooting. I intend to spawn a spark particle system (particles emit to Z) when a bullet hits a surface. I want to align the Z axis of the newly spawned particle system to be

a) in a 90 degree angle to surface that has been hit
b) in a reflective angle from the original trajectory

I know that i can "fake it" by setting particle Z to World 90 degrees, however then it will do so on any angled surface, while i would like to have the particle system dynamically orient itself in a 90 degree angle away from the surface that has been hit/ Or reflect into the direction away from the incoming bullet.

hope you can help me, getting quite frustrated.
i added a quick drawing of my intent

ivam

  • Playmaker Newbie
  • *
  • Posts: 34
Re: Align spawned particle system
« Reply #1 on: October 29, 2016, 12:22:39 PM »
anyone ?  :-\

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Align spawned particle system
« Reply #2 on: October 30, 2016, 03:40:23 AM »
If you want to align something to a hit surface you use a cast of some type(Raycast, Spherecast, etc)

From the cast you would take the hitnormal and the hitpoint and use that to align a spawned object to the surface-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!