Jump to content

How to change Particle direction


Allan
 Share

Recommended Posts

Hey everyone ! I'm working on applying flame particles on my model but i have a problem.

On the first screenshot, the flames are in the good direction because the values are made manually to be like i want it to be.

In the second screenshot, the values are the same but i moved my unit around and there's a problem : the particle direction doesn't follow the movement of my units. (You can see on the screenshot that the flames are going in the wrong direction because of my "static" values).

If someone has a solution to make the particle working like the first screenshot even if the unit moves, it would be appreciated. 

Thanks ! :)

hunter.png

hunter_2.png

Link to comment
Share on other sites

Hey @Allan

You need to add the following tag to your particle effect:

<use_relative_velocity/>

So in your case:

<?xml version="1.0" encoding="utf-8"?>
<particles>

    <texture>art/textures/particles/flame.png</texture>
    <blend mode="add"/>

    <start_full/>
    <use_relative_velocity/>

    <constant name="emissionrate" value="20.0"/>
    <uniform name="lifetime" min="1.0" max="1.5"/>


    <uniform name="velocity.x" min="-2" max="-2.5"/>
    <uniform name="velocity.y" min="-0.3" max="0.3"/>
    <uniform name="velocity.z" min="2" max="2.5"/>
    <uniform name="velocity.angle" min="-3.14" max="3.14"/>

    <uniform name="size" min="1.0" max="2.0"/>

    <uniform name="color.r" min="0.8" max="1.0"/>
    <copy name="color.g" from="color.r"/>
    <copy name="color.b" from="color.r"/>

</particles>

I removed the following line in my screenshot for it to be straight.

    <uniform name="velocity.x" min="-2" max="-2.5"/>

image.png

  • Like 1
  • Thanks 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...