Change Actor's Z Position?

jilliansjillians Member Posts: 33
edited November -1 in Working with GS (Mac)
I am making a game where you pick something up and put it somewhere else. When i pick up an actor, i want them to sort in front of things so they don't get lost when you place them where they need to go. Right now they are somewhat hidden and occluded by objects until you pick them up, and that is part of the game.

Does anyone have any ideas on this? Can you change Z position? Or the layer on which the actor currently presides?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    You can't currently change the layer order unfortunately.

    What I'd do is set up your own set of rules that dictate what gets placed in front of what.

    But then, I'm not sure how you'd show that.

    Hmmmm....

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

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    well gamesalad is only 2d so theres no z. But if you click the scene tab inside a scene then layers youll see all the layers and be able to make new ones, change there order, order of actors in them, ect

    edit: i misunderstood. If your talking about ingame then refer to qs's post above
  • quantumsheepquantumsheep Member Posts: 8,188
    Yes, I should have said 'Can't change the layer order *dynamically*'

    QS :D

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

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    quantumsheep said:
    Yes, I should have said 'Can't change the layer order *dynamically*'

    QS :D

    ;)
  • jilliansjillians Member Posts: 33
    doh... Work around solution is to destroy actor, and spawn an actor spawner that respawns the actor on the new layer..... Lets seee if that works!
  • quantumsheepquantumsheep Member Posts: 8,188
    jillians said:
    doh... Work around solution is to destroy actor, and spawn an actor spawner that respawns the actor on the new layer..... Lets seee if that works!

    Good luck! :D

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

  • expired_012expired_012 Member Posts: 1,802
    jillians said:
    doh... Work around solution is to destroy actor, and spawn an actor spawner that respawns the actor on the new layer..... Lets seee if that works!

    Wouldn't all of that spawning hurt performance?

    What I would try to do it make a duplicate of whatever your actor you're dragging, set it's alpha to 0, and constrain its X and Y positions to the original actor.
    Then you can change that top actors alpha to 0 or 1 whenever it's needed, to make it seem like its going to the "top" or "bottom" layer.

    Not sure if that answered your question or was any help at all, but just throwing out ideas here.
  • jilliansjillians Member Posts: 33
    I ended up just working completely around this. Thanks guys for the input. This feature should definitely be considered, z order is a really useful tool.
  • UtopianGamesUtopianGames Member Posts: 5,692
    We did something similar for the Zanda Template.

    What i did was have 2 hero actors and swap them depending on his Y position in relation to objects like trees and fences so the hero can walk in front and behind.

    The effect is probably the best solution to layers atm.

    I would not recommend lots of spawning.

    See video below.



    Darren.

    image
Sign In or Register to comment.