Instantiate a character sprite in a canvas

Posted: 08 Apr 2021 15:04
by juan.delcastillo

I'm currently creating a VN with 3D scenarios. When a character sprite spawns, since the main camera is on perspective, the sprite has a depth value and thus it doesn't necessarily spawns where it should (for example, it can't be seen because it spawns behind the scenario). This obviously doesn't happen with an ortographic camera but I'm currently working in a team and the designer wants the game to be on perspective mode

There are basically three cameras in the scene: the main camera (depth 1), the camera manager (depth 0) and the UI camera (depth 2). I've tried experimenting with camera depth but it doesn't solve anything, sorting canvas order has no effect either

It seems the only way to spawn it is an image component of a gameobject, that has to be a children of a canvas. Any tips?


Re: Instantiate a character sprite in a canvas

Posted: 08 Apr 2021 21:34
by Elringus

All the built-in char and back implementations except generic are drawing to render texture, which is then rendered by the main camera. If none of them suit your needs, you can create a custom one: https://naninovel.com/guide/custom-acto ... mentations. You can also try render to texture feature, which allows routing the render data to a custom texture, which you can then embed anywhere (eg, in a UI canvas): https://naninovel.com/guide/characters. ... to-texture