Special Projectile Behavior: After Effects

TosanuTosanu Member, PRO Posts: 388

God I hope I explain this properly, because its REALLY specific what i need.

Ok, so I am creating an enemy for my 2D game that throws a water/ice projectile. When it strikes, it leaves behind a field that reduces traction (represented by adding interpolation to movement start and stop) for a short period of time. The field, of course, is a second Actor. When it hits the ground, the projectile is despawned and creates the field, which despawns on a timer.

Now what i want to do is make it for the Water Ball(lets call it that) to have an effect that if it hits something in midair, the field is seeded on the ground directly below where it strikes, like a ball of water breaking apart and forming a puddle out of the rain of droplets. I am racking my brain as to how to make it do this, however. I dont want the field to appear in midair, since that would be a strange visual effect. Is there a way to, i dont know, scan the space between two objects and have it generate a second object using that information? Or to fake it in some way?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188

    Simple way would be to give the field that's spawned as the puddle some simple rules.

    For example.

    When spawned:
    moved downwards
    Alpha set to 0

    If it hits the ground actor:
    Set Alpha to 1

    Make sure your friction on the actor (under 'physics' ) is set to 0 so it doesn't bounce when it hits the ground.

    The way this works is, soon as the puddle is spawned, it moves downwards but isn't visible.
    When it hits the ground, it's suddenly visible.

    Simples :D

    Hope it helps,

    QS =D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.