Actor in front and behind another actor

Hey all, lets say I have a tree. I want it so that when my hero/actor goes behind the tree you cant see him anymore (like a 3d effect). However, when hes in front of the tree its like the tree is behind him and it looks 3d. The reason for this is because Im doing an overhead game but the art is 2d. Thanks so much. Appreciate the help.

Chris

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    The best example I've seen of this is DeepBlue Apps' Zelda template: http://www.deepblueapps.com/zanda-zelda-template/

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mrchris317mrchris317 Member Posts: 78
    Thanks for the guidance. Appreciate it:)
  • SocksSocks London, UK.Member Posts: 12,822
    Thanks for the guidance. Appreciate it:)
    It's fairly straightforward, just have two copies of the same actor locked to each other, always doing the same thing.

    One actor has its alpha channel turned off (0) and is on a background layer.
    The other has its alpha channel turned on (1) and is on a foreground layer.

    The object you want the actor to go around is on a layer in between these two actors.

    When you want your actor to be behind the object turn the background actor's alpha channel on (1) and the foreground's alpha channel off (0).

    You can place triggers around your object to do this automatically for you.

    I am doing this in a game I am working on, it works really well.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Yes, and what @Socks describes is the method employed in the Zelda template I referred to. It's moderately difficult if you're new to GameSalad. In that case, I'd recommend the template... perhaps after you've built a few games from scratch. If you're fairly competent, you could give it a go with Socks' instructions or buy the template and look through it for guidance. I think you'd be fine either way.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mrchris317mrchris317 Member Posts: 78
    Thanks tatiang I will look into both options. I appreciate your input:)
Sign In or Register to comment.