how to make depth Object higher when have lower -y(botom).

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By potatobanana

i want to make playerSprite on top mobSprite when playerSprite in front of mobSprite. and mobSprite on top playerSprite when mobSprite in fornt of playerSprite.

i try

func depth_control():
	var depth = int(-move_direction.y)
	z_index = depth

it work when me moving but not work when me idle.

:bust_in_silhouette: Reply From: ZacB

Where do you call this function ?

func _physics_process(delta):

potatobanana | 2018-08-09 18:26