0 votes

i am now sure how can i make my background(forest) appear behind the character or make my character appear to move on it, since i cant view the character.

Here is the hierarchy and what i see in the game!

What i see:
https://imgur.com/oODDEeV
Scene Hierarchy:
https://imgur.com/xq4uIgT

Edit: should i place the player inside the background scence instead? like this: https://imgur.com/wzI9Iv1

in Engine by (37 points)
edited by

1 Answer

+5 votes
Best answer

Hi! To make the player just be always in front of the background, you only need to put the player below the background in the tree hierarchy. You don't need the player to be inside the background, just below it.
The things in the tree are being rendering in that order, so if you have the player and then the background, when rendering the background, player would be behind. If you have background and then player, as you render the player last, you will see it in front. Just that.
You could also set z index of player to 1, or higher value if needed.

However, your image seems to be some kind of top-down game? in that case, you should put all your objects (character, maybe the house?) under an YSort node, so you can render the player infront of the house when moving in a lower y, and behind the house if you move it in a higher y.

by (3,503 points)
selected by

Thanks it works now! You are right is a top-down game, is this what you ment with Ysort:
https://imgur.com/c8OAa4H

Hi! Glad to help. The link you provided seems not to work.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.