Add shadows to characters

hi, can you tell me if there is a way or extension to be able to add shadows to my characters in a top down game?

1 Like

Two ā€œclassicalā€ ways of doing that would be to:

  1. draw the shadow together with your character sprites;
  2. make an additional shadow sprite, attach it to the character sprite.

Does the drop down shadow effect do what youā€™re after?

Yes I was looking for something simple

Hi ilary27, thereā€™s an extension called Animate shadow clones. Thereā€™s also an extension called called Reflection which is probably simpler. I havenā€™t used either.


image

1 Like

Where am I doing wrong? I have created a shadow object and I would like to apply it to all containing objects in the group containing the shadow effect.

What is it doing instead.
In what set of events did you create the shadows to stick to the shadowobject?

i corrected the screen, the creation is done in that event.
what happens is that no shadows are created

I havenā€™t ever (successfully) used that extension. So just giving basic trouble shooting ideas. First Iā€™d check to make sure I had actually added the objects into the group. Then Iā€™d check the debugger to verify there really are no instances of shadows in the scene. Then Iā€™d try another condition than the one I was using. Maybe Iā€™d try NOT instead of inversion for that condition, or Iā€™d try inverted shadows collision with shadowobject, or Iā€™d make up a bool in events (not actually in the objects variables list since itā€™s not like youā€™ll be using this for anything else) saying shadowobject bool shadow is false, do all this and set bool to true.

I am not completely sure about that but I think you cannot use the sticker extension on groups (I tried a bit). If I have one object it works without problems (the invert condition in your ā€˜repeatā€™-block is also not working for me). So I would suggest to check your events first with one object and then try it on the object group.

That makes sense, maybe that is why my one attempt to use the sticker extension was unsuccessful. But the Pin Object To Another example does work for groups if the op would rather try that.

Also using that formula builds character.

Editing to say: specifically, Iā€™ve only used the Pin Object To Another to pin objects from a group to a specific object. Thatā€™s opposite of what youā€™re trying to do, so that may not work either.

1 Like

Ok since Iā€™m working on the level editing logic of my project tonight, and I need to stick one object to each object in a group anyway, I decided not to do it as usual but to try the extension instead to see if I can figure out whatā€™s going on for you.

This worked.

Adding a condition like you had did not work at all.
Adding the condition AnimalHabitats is in collision with CollisionCheck, inverted, worked.
Adding CollisionCheck is in collision with AnimalHabitats, inverted, did not work.

Thatā€™s under At beginning of scene events. I have not made the logic for purchasing more Habitats from the shop yet so I canā€™t test it on objects created in game.

1 Like

hi, thanks for your helpā€¦ unfortunately it didnā€™t work for me because the enemies are created at the beginning of the scene.
I think the problem is the ā€œstickā€ extension.

I got it to work when creating stuff in the same project. Are you creating an enemy and then immediately creating a shadow and sticking it to the enemy?

Hi Lucky-j, I succeeded by moving the shadow creation event but I had to add a once trigger otherwise lots of shadow sprites were created.
is this correct?

one more thing i would like to askā€¦ is there a way to block the scaling of the shadow? when my enemies change animation the shadow keeps changing width

I say if you got it working it is correct!

Here is my event for comparison. I create Shadow immediately after I create Patron and then stick the shadow to patron. Now notice I have the Shadow on a different layer than Patron so I also have to copy camera movement for Base Layer to Floor layer, otherwise the shadows will not be shown. (For instance, I use drag camera with mouse extension and also the pinch extension for zooming, and if my GameState is in Edit I use the edge scrolling extension too).

For your scaling, I canā€™t tell if the scaling event you made has any sort of condition to in in an above event. But if not you can try to say Bool Shadowed of object Playerhitbox is false, then say create shadow, change width etc and as a last event set bool to true.

1 Like