Couldn’t find any info on this, what i basically want to do is to create a particle system through script
But i cant figure out how to create the particle emitter!
Any ideas ? i dont want to use the Prefab workaround…
.org
Couldn’t find any info on this, what i basically want to do is to create a particle system through script
But i cant figure out how to create the particle emitter!
Any ideas ? i dont want to use the Prefab workaround…
.org
var go : GameObject = new GameObject("foo");
var pe : ParticleEmitter = go.AddComponent(ParticleEmitter);
var pa : PArticleAnimator = go.AddComponent(ParticleAnimator);
var pr : ParticleRenderer = go.AddComponent(ParticleRenderer);
After that you have references to the comonents and should be able to tweak it as much as you like.
That said, prefabs shouldn’t be considered work-arounds unless you insist on setting every variable using a script.
Ok… tried that before you even posted it and i got this:
Can't produce abstract class
UnityEngine.GameObject:AddComponent(Type)
TestPE:Start() (at Assets/Test/TestingParticleEmitter/TestPE.js:6)
[ParticleEmitter.h line 14]
o == NULL
UnityEngine.GameObject:AddComponent(Type)
TestPE:Start() (at Assets/Test/TestingParticleEmitter/TestPE.js:6)
[BaseObject.cpp line 324]
Can't add component because the component 'ParticleEmitter' can't be produced.
UnityEngine.GameObject:AddComponent(Type)
TestPE:Start() (at Assets/Test/TestingParticleEmitter/TestPE.js:6)
[MonoExportUtility.cpp line 601]
So i cant AddComponent() a ParticleEmitter because its abstract… but then i tried to find something about the Ellipsoid Particle Emitter and i could not find any info about it…
The type EllipsoidParticleEmitter is not even recognized…
Assets/Test/TestingParticleEmitter/TestPE.js(6,53): BCE0005: Unknown identifier: 'EllipsoidParticleEmitter'.
Thanks
.org
So… i cant create a particle system from script then…
![]()
.org