Proper Set Up of Layered Background

General development topics: using various Unity tools, publishing games, etc.
Post Reply
gradstein
Posts: 22
Joined: 09 Sep 2020 19:03

Proper Set Up of Layered Background

Post by gradstein »

Hi there,

I'm a bit confused on proper layered background set up. I have a layered background with a lot of groups and layers, set up like this: LivingRoomDecor -> DecorType > Item. A room I essentially want to decorate as a player.

In the prefab, I started with every group and layer inactive except for the base room layer which was active. When I try to toggle on a layer in nn script using @back Floors>LightWood, i get an error that it cant be found.

If I start with everything Active in the prefab, but turn all groups off in script at the top between a start and finishtrans, then use the above command, it works, but thats a pretty big load.

Am I doing something wrong, or does every group and layer need to be ACTIVE in the prefab and then controlled on/off with script commands?

gradstein
Posts: 22
Joined: 09 Sep 2020 19:03

Re: Proper Set Up of Layered Background

Post by gradstein »

Also, I'm curious... will it save the state of this background (i.e. which layers are on/off) the next time I call it? Even if its in a different script? Or do I need to drop in some booleans to track and check for them next time I call it?

idaot
support
Posts: 260
Joined: 01 Aug 2020 08:25

Re: Proper Set Up of Layered Background

Post by idaot »

You can toggle any layer on/off freely before entering play mode. Make sure you are not disabling the objects themselves, but rather enable/disable the Sprite Renderer components.

As for the state, when the actor has been unloaded via @hide or script loading process, it will return back to the default state which is either the "Default" appearance/key or the layout you left it at when entering play mode, unless you specify a different appearance/key upon calling it. You can use custom variables if you want the state to be remembered somehow, but my recommendation is to create composition maps so you can call any complex setup with a single keyword. https://naninovel.com/guide/characters. ... characters

Post Reply