Search Unity

Question Particle Collision direction dependent

Discussion in 'Scripting' started by ChrisSheeler, Apr 2, 2023.

  1. ChrisSheeler

    ChrisSheeler

    Joined:
    Mar 29, 2013
    Posts:
    4
    Hey everyone,

    I'm making a 2D game. When the character gets hit it loses coins, and spits out a bunch of coin particles in a particle system. The Particles have gravity and collisions on them, but what I want is for them to ONLY collide while they are falling, not while they're shooting into the air before they start falling, as though every platform is a one-way platform.

    Any ideas?
     
  2. samana1407

    samana1407

    Joined:
    Aug 23, 2015
    Posts:
    243
    Wouldn’t it be easier not to use particles, but to create a pool of coins out of simple sprites with a rigidBody2d? Each such "particle" simply turns off its collider after some time, for example, a couple of seconds to have time to hit something, and then suddenly fly through any obstacles to any direction.