1 like 0 dislike
251 views
Hello,

I'm having an issue with a PlanarAlignedQuad being used in local space. Basically I have a thruster effect made from quads that are aligned to be flat and other ones vertical as part of the effect. When I spawn the effect in Unity to the game object, I'm trying to get the effect to rotate with the game object, but I'm finding that the quads are always aligned to the scene's axis, not the game object's. I've tried using the Local Space evolver, but it doesn't seem to affect it.

Here is a package of the effect:
https://drive.google.com/file/d/0B7QfwKNb-3flMnc3VlI3MncxWEE/view?usp=sharing

I'm using Unity 5.4.0f3, PopcornFx plugin 2.7, editor 1.10

Thanks!
by jankoz (330 points)

1 Answer

1 like 0 dislike
 
Best answer

Hi,

it seems to be a classic LocalSpace issue.

Taking your Thruster_Side as an example, Flame_Axis/Flame_Axis2 are used for the PlanarAlignedQuad billboarding mode. Thus, if you want them to be transformed appropriately by your emitter's transforms, you need to make sure those two fields have the proper transformation modes.

Then, by nesting your script evolver within a Localspace Evolver, what it does:

  • Transform from World to Local all fields marked with "Rotate" or "Translate" or "Rotate/Translate"
  • Execute your script evolver with all fields transformed (here AxisFlame will be float3(1, 0, 0))
  • Transform back from Local to World (AxisFlame will now have its original float3(1, 0, 0) transformed correctly in worldspace, relative to the emitter transforms)
  • The renderer will now billboard using the correctly transformed axis

Also, as shown in the picture below, feel free to use "scene.axisSide()/scene.axisUp()/scene.axisForward()" which will be replaced by the correct value depending on your project's axis system. Say you switch from Unity to UE4, it'll save some time.

Hope this helps

by HugoPKFX (17.5k points)
Awesome, thank you Hugo! Took a little while to reset everything and test it out, but we got it. Really appreciate it.

https://gfycat.com/HealthyHeftyAdamsstaghornedbeetle
Glad to hear it helped you resolve the issue,
Really nice result btw :)
...