Add a shadow effect to an actor

TobyToby Member Posts: 478
What's the best way to add a shadow to an actor?

I can include the shadow in the graphic, but the shadow collides with other actors because it's offset quite a bit to create the illusion of depth. Not the best solution.

- I've tried duplicating the actor, coloring it and removing the collision behavious etc
- This approach kinda works but the shadow sometimes falls off and loses the X & Y coords.

I imagine there is a simpler or better way?

Comments

  • KamazarKamazar Member Posts: 287
    Make the shadow a totally different actor. Constrain the X and Y position of the original actor to scene attributes. Then constrain the shadow's location to the X and Y points, but add to the points to offset it's location. No other behavior besides the ones needed to constraint the location.
  • TobyToby Member Posts: 478
    Ahhh, yep with a little experimentation and trial and error it works with the constrain etc as suggested. I still needed the shadow to rotate with the player ship so I left the rotate commands in. I think i had the basics, I was just muddled up. (Not unusual really)
  • sebmacflysebmacfly Member Posts: 1,018
    Hi Kamazar, can you explain a little more please? i'm french, i don't understand all... Thank you...
  • sebmacflysebmacfly Member Posts: 1,018
    Anybody can help me on how to make an actor shadow?

    Thanks
  • KamazarKamazar Member Posts: 287
    Wow, I posted this a while back. Well... I don't know how else to explain this. Basically, make another actor for the shadow, and have the shadow follow the main actor behind it. Make sense?
  • synthesissynthesis Member Posts: 1,693
    create two separate actors...one is the main actor, the second is the shadow.
    Report 3 constrained variables from the main to the game:
    - the X Position
    - the Y Position
    - the rotation

    Then in the shadow actor (which is placed on a layer below the main actor)
    constrain those 3 game variables to the shadow actor.
  • haim96haim96 Member Posts: 87
    i also changed the shadow size when the actor jump... looks nit! :)
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    you could also try not using 'constrain' as it is processor heavy.

    and simply put a semi transparent shadow around the character on a png.

    So the shadow is part of the characters image.

    obviosuly this has limtations....
  • UPUP Member Posts: 70
    Hi all, (my first post, I'll try not to make a fool of myself... :-] )

    Stuck with a related issue..
    What I got to work: Shadow follows a ball which is spawn when mouse is clicked in a certain area.

    Problem is, ONLY the first ball has a shadow, any other ball spawn after does NOT...
    BUT hold on, actually a shadow IS being spawn for each next ball,
    but it's being ADDED to the FIRST BALL??!! (does this make sense to anyone so far??)

    So now the first ball has a shadow behind it which is just betting darker + thicker...
    I'm lost in what to adjust so a shadow is spawn for each spawn ball...

    By the way, I'm simply following the Gamesalad PACHINKO tutorial, but attempting to add
    some effects along the way which I'll be using for my first game creation.

    Thanks for any help guys!! Loving Gamesalad already after a couple of hours messing around!!
Sign In or Register to comment.