Forum rules - please read before posting.

Player shadow in 2D game

edited November 2015 in Technical Q&A
Hi one more time!!

What is the best way of make the player's shadow in a 2D game?

Many thanks!!

Comments

  • i'd love to know too.
  • I just child a semi-transparent squished oval dark spot to the bottom of my characters feet, works fine for me.
  • Indeed - the 2D Demo game's Brain2D player prefab demonstrates this technique.

    Attach it as a child of the main sprite child, then make sure your Follow Sorting Map component (on the main sprite) has Offset original Order? checked.  This will make sure the relative difference in sorting order between your main sprite and shadow sprite will be retained.
  • THANKS!!!

    Another question about this... When the character walks, the legs are in movement (logically), but the shadow not changes your size according the separation of the legs. Is there a way to assign a different shade for each sprite movement?

    Thanks again!
  • :) But the body still casts the shadow, right?
  • edited November 2015
    Yeah! That's!!
    The shadow
    should change with every movement of sprites...
    Is this possible?
  • In my opinion, this is highly complex for a such an unimportant detail that no player would care or
    notice much :)  You would need to take into account the lights placements calculate an angle, adjust a distortion to the shadow and make the shadow rotate dynamically, what if your lights sources are moving?

     If you really want a more or less detailed legs, arms, torso, head shadows you would need to make a sprite sheet animation and child it to your main 2d character as semi-transparent animation.
    All in all lots of troubles and work.
     Surely just a childed semi-transparent squished oval dark spot to the bottom of your charcter won't get bad reviews from your players ;)

     I don't know what budget you have but spending time and money on it wouldn't bring more sells.
    Some work pipeline strategy rethiniking might be required in order to complete your game.
  • It's more work, sure, but still possible: just animate the shadow sprite inside your character's regular animation clips.
  • I not really intend to do something so complex. Before using "AC" used WME (Wintermute problem is that this engine is that it is only for PC), and allowed to use a "subsprite" or sprite "children" in each sprite, so that when the animation is created each sprite had a sprite for shade.

    Thanks for the answers. I think the best option is to include the sprite shadow on the main sprite animation.
  • Thanks all
  • edited May 2016
    ummm... you might want to check these assets, they may or may not be for your though (cause I don't know what kind of visuals you are striving for):

  • Sorry to necro an old post. I tried this and it works great but can cause some issues with collision with the navmesh since the shadow object is below the feet. Is there any way to fix this?

  • Yeah, it's simple! You just need to reposition the character's collider to coincide with the feet.

  • Wow I didn't think about repositioning the collider, that is very simple and solves issues I had with cropping on my animation frames. Thank you Rairun!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.