particle direction to centre

Discussion in 'Programming' started by Kyon, Jul 11, 2018.

  1. Kyon

    Kyon Member

    Jun 27, 2016
    Hi everyone,
    how would I set the direction of my particles to the centre of the emitter?
    So, I want to create this ellipse emitter, and use ips_distr_invgaussian to spawn then mostly at the edge of the ellipse.
    But I want the direction of the particles to be towards the centre of the ellipse. Is that possible?
  2. Kyon

    Kyon Member

    Jun 27, 2016
    Alright I guess I solved it a bit, not using an emitter at all did the trick haha.
    So for the readers who got this problem too, what I did was this:
                    var partdir=irandom(360);
                    var partdist=irandom_range(16,32);
                    var xxx=xx+lengthdir_x(partdist,partdir);
                    var yyy=yy+lengthdir_y(partdist,partdir);
                    var partdir2=point_direction(xxx,yyy,xx,yy);
    xx and yy being the centre and partdist being the distance from the centre
    (absorbpt and absorbsys are from my created particle system)

    So I tweaked it a bit and this is the effect in-game:
    arirish, Ido-f, TheSly and 1 other person like this.
  3. RefresherTowel

    RefresherTowel Member

    Jul 13, 2016
    Yeah, there are a few things like that within the particle system where you have to reset speed/direction/etc of the system for each time an individual particle is created. It's a bit CPU heavy but used appropriately it can yield good results (as can be seen by your screenshots).
    Kyon likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice