# How i can change particle color depending from the distance to the Emitter

**URL:** <https://forums.unrealengine.com/t/how-i-can-change-particle-color-depending-from-the-distance-to-the-emitter/112830>\
**Category:** FX\
**Tags:** unreal-engine\
**Created:** [June 28, 2018, 10:58am UTC](https://forums.unrealengine.com/t/how-i-can-change-particle-color-depending-from-the-distance-to-the-emitter/112830 "2018-06-28T10:58:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leafar77](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@leafar77](https://forums.unrealengine.com/u/leafar77)\
**Post date:** [June 28, 2018, 10:58am UTC](https://forums.unrealengine.com/t/how-i-can-change-particle-color-depending-from-the-distance-to-the-emitter/112830/1 "2018-06-28T10:58:05Z")

</div>

I have a particle that gets some inital velocity in random directions , and then it get attracted back via Point Attractor.  
I need to change the color the further it is away from the Attractorpoint ( wich is same as emitter in this case) and back to its starting color when its close.  
there is no way to archive this with Color over Life as the Random movement is unpredictable.  
any ideas ?  
thx in advance

---

<div class="post-metadata">

**Author:** ![spazfirem](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spazfirem](https://forums.unrealengine.com/u/spazfirem)\
**Post date:** [June 28, 2018, 5:00pm UTC](https://forums.unrealengine.com/t/how-i-can-change-particle-color-depending-from-the-distance-to-the-emitter/112830/2 "2018-06-28T17:00:42Z")

</div>

[https://docs.unrealengine.com/en-us/…ence/Particles](https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/ExpressionReference/Particles)

The above link probably has what you are looking for, ParticlePositionWS. There are also many other material expressions that may come in handy. You may have to tweak something for local space, but worth a shot.

---

<div class="post-metadata">

**Author:** ![leafar77](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@leafar77](https://forums.unrealengine.com/u/leafar77)\
**Post date:** [July 3, 2018, 7:17am UTC](https://forums.unrealengine.com/t/how-i-can-change-particle-color-depending-from-the-distance-to-the-emitter/112830/3 "2018-07-03T07:17:08Z")

</div>

thx that did the job !
