# startPositionFunction not with GPUParticleSystem

**URL:** <https://forum.babylonjs.com/t/startpositionfunction-not-with-gpuparticlesystem/7221>\
**Category:** Questions\
**Created:** [November 26, 2019, 4:04pm UTC](https://forum.babylonjs.com/t/startpositionfunction-not-with-gpuparticlesystem/7221 "2019-11-26T16:04:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_McLaut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/robin_mclaut/32/5503_2.png) [@Robin\_McLaut](https://forum.babylonjs.com/u/Robin_McLaut)\
**Post date:** [November 26, 2019, 4:04pm UTC](https://forum.babylonjs.com/t/startpositionfunction-not-with-gpuparticlesystem/7221/1 "2019-11-26T16:04:23Z")

</div>

Hi everyone,

I use the startPositionFunction to set randomly the startPostion of the particles along the surface of a bunch of meshes and wanted to use it with the GPUParticleSystem. But it seems that this function (and the direction function) only works with the ParticleSystem.

Are there any suggestions how to set the startPosition for particles at specific coordinates with the GPUParticleSystem?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 26, 2019, 4:30pm UTC](https://forum.babylonjs.com/t/startpositionfunction-not-with-gpuparticlesystem/7221/2 "2019-11-26T16:30:28Z")

</div>

You have to use the emitter for that. GPUparticles do not let you be more precise as all the code is running inside the GPU

---

<div class="post-metadata">

**Author:** ![Robin\_McLaut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/robin_mclaut/32/5503_2.png) [@Robin\_McLaut](https://forum.babylonjs.com/u/Robin_McLaut)\
**Post date:** [November 26, 2019, 4:33pm UTC](https://forum.babylonjs.com/t/startpositionfunction-not-with-gpuparticlesystem/7221/3 "2019-11-26T16:33:53Z")

</div>

Yep yep, that’s clear to me. Here are some parts of the code:

```
particleSystem.particleEmitterType = new BABYLON.BoxParticleEmitter();
particleSystem.startPositionFunction = (worldMatrix, positionToUpdate) => {
	let vert = vertices[verticesKeys[random(0, verticesKeys.length - 1)]];
	return BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(vert.p.x, vert.p.y, vert.p.z, worldMatrix, positionToUpdate);
}

```

this code works perfectly well with ParticleSystem but not with GPUParticleSystem.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 26, 2019, 4:35pm UTC](https://forum.babylonjs.com/t/startpositionfunction-not-with-gpuparticlesystem/7221/4 "2019-11-26T16:35:10Z")

</div>

Yep. As I said this is not supported

---

<div class="post-metadata">

**Author:** ![Robin\_McLaut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/robin_mclaut/32/5503_2.png) [@Robin\_McLaut](https://forum.babylonjs.com/u/Robin_McLaut)\
**Post date:** [November 26, 2019, 4:37pm UTC](https://forum.babylonjs.com/t/startpositionfunction-not-with-gpuparticlesystem/7221/5 "2019-11-26T16:37:14Z")

</div>

Ah okay, that was not clear to me in your first response.  
Thank you!

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 26, 2019, 4:45pm UTC](https://forum.babylonjs.com/t/startpositionfunction-not-with-gpuparticlesystem/7221/6 "2019-11-26T16:45:57Z")

</div>

Oh sorry 🙂 Yeah I meant that you can only change the emitter position but not each individual particles when using GPU particles
