Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Particles in 2D pixel art game

Discussion in '2D' started by BusyRobot, Mar 9, 2015.

  1. BusyRobot

    BusyRobot

    Joined:
    Feb 22, 2013
    Posts:
    148
    I can't see to get particles to appear properly in my 2D pixel art game. I'm using SpriteTile to create the tiled level.

    The first thing is, when I create a particle emitter in the scene, it doesn't appear. As I understand it, this is due to the sorting layers, that the particles appear on a bottom layer, and you need to use a script to set the layer. I've tried this as well, but when I do that, the particles move in 3D as they are emitted, i.e when I scroll left/right, some particles move at a different horizontal speed to others, and it looks all wrong. I need the particles to stay in the x,y axis only.

    I've looked on here and can't see any solutions to having particles in 2D games, but I know it's possible because games like Broforce use 2D particles (they said they use Unities particle system in an interview) and they work great.

    Does anyone know how best to do it? or are there any plugins that help with the issues? (I've looked on the asset store and couldn't see any).
     
  2. BusyRobot

    BusyRobot

    Joined:
    Feb 22, 2013
    Posts:
    148
    Just to add a bit of extra info. I think my problem is that I have to use a perspective camera, the reason for that is because I have parallax scrolling, but I think that also makes the particles move in perspective. So what I need to know is, how can I have 2 particles with using a perspective camera?
     
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Hey Biggerplay - I don't know the solution to your problem, but I've seen the exact same issue posted on these forums several times. And I believe the only 'solution' I remember reading about was using multiple cameras. I can't say what setup is needed for the particles to show properly but if I had to guess, I would say the particle camera should be orthographic? :confused:
    Sorry for the vague reply.
    A more experienced person to ask would be @imaginaryhuman. He always has great feedback on multiple camera setups.
     
    BusyRobot likes this.
  4. BusyRobot

    BusyRobot

    Joined:
    Feb 22, 2013
    Posts:
    148
    I managed to get it working eventually by forcing the z velocity to be zero. I also had to create my own particle system because Unitys own particles don't work with 2D colliders evidently, but my own system is working great :)
     
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Oh cool! Glad you found a solution.
    You wrote your own particle system? That's awesome.
    So saving this as a solution for 'my future' 2D particle troubles won't work, cause code = sanskrit to me. :)

    My (theoretical) artist solution is to use particle systems externally (Max AE) and bring them in as animated sprites.
    But I can understand why this wasn't considered in this instance with the perspective camera.
     
  6. BusyRobot

    BusyRobot

    Joined:
    Feb 22, 2013
    Posts:
    148
    When I say my own "particle system" all I mean is an emitter which throws out game objects, you can set the vectors/velocities yourself and you have particles which collide with tiles and look great.
     
    theANMATOR2b likes this.
  7. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Oh - excellent!
    Thanks for the follow up Biggerplay.

    Love these forums and the fellow developers. Learn something new nearly every day!
     
  8. codejoy

    codejoy

    Joined:
    Aug 17, 2012
    Posts:
    204
    Just curious did you pool those particles @Biggerplay?