Search Unity

Question DrawMeshInstanced / ECS Based Animation not working on Game window

Discussion in 'Animation' started by scarface117, Jun 23, 2020.

  1. scarface117

    scarface117

    Joined:
    Nov 9, 2019
    Posts:
    16
    Hi Everyone.
    I'm trying to do a little experiment on animations using Entity Component System.
    I'm basically applying what's done here:


    I'm using DrawMeshInstanced to draw layer batches, and each layer has a small Z difference.

    The experiment has a top down view.

    For instance, I have drawings that consist of 3 Layers:
    Torso / Arms / Head , Head will have the greatest Z value, in order to appear on top of Arms and Torso. Torso has the least Z value, therefore it will be on bottom.

    Since this has a Top down view, I'm calling DrawMeshInstanced on bottom sprites first, and top sprite last, that way they are rendered in the right order, one on top the other.

    I'm seeing a weird issue where the drawings look good on the 'Scene' view but once I go to the 'Game' view, they're not entirely rendering (seems like some parts might be blocking the others, but I don't get why it only happens on Game view)

    Here's an example:




    Does anybody know what could be happening here?

    Regards!