04-01-2018, 07:25 PM
(This post was last modified: 04-01-2018, 07:26 PM by josemendez.)
(04-01-2018, 12:43 PM)hmhmhm Wrote: Thank you Jose, for the quick and detailed reply. I had indeed not set the Mode to 2D. That immediately removed the problem of the particles leaving the 2D plane. I then checked the phases and they were 1 for the emitter and 0 for the game object by default. So all I did was change the mode to 2D, but that still leaves me with the problem of particles entering the object:
This what the inspector looks like for the emitter:
Is there anything else I am doing wrong?
Thank you for the hint regarding 'extending the ObiEmitterShape class'. Is there a tutorial or an example of this available for me to look at? I'm aiming for a triangle shape.
Once again thank you!
Hi!
Your emitter scale is negative. That means it is turned "inside out", so particles will collide with its inner walls. Set the Y scale to 0.1 instead and it will work as you expect.
Extending classes is a basic C# skill, so I assume you already know how to do that. The details on what to do when extending it are:
-Set samplingMethod to FILL in the Awake() method.
-Override the two abstract methods of the base class (SupportsAllSamplingMethods() and GenerateDistribution()).
-SupportsAllSamplingMethods should return false.
-In GenerateDistribution, simply fill the distribution List<> with distribution points. These are the places in the shape where the particles will spawn. Each point has a position and a velocity. You probably want their positions to resemble a triangle
All included emitter shapes (ObiEmitterShapeDisk, ObiEmitterShapeCube, ObiEmitterShapeEdge, etc) extend from ObiEmitterShape, so you can look at them as examples.
cheers