Hi everyone,
I hope you are having a wonderful day!
I am trying to make a 2D minigame in which you have to dress your character. There are 3 layers of clothing (underwear, middle and top). Higher layer is unlocked when all items from previous one are present on the character.
I dragged all underwear layer clothing on the character, gave each Hotspot and Polygon Collider and then deleted sprite from Sprite Renderer.
Hotspot has Inventory Interaction - when you drag right item to it, it's sprite should appear on it and both Hotspot and polygon collider gets deleted, so only newly added sprite remains.
I read you have to add sprite to object with ActionList's Object: Animate function, but I was unable to make it work. Can anybody, please, help me with it?
I was able to work around it by dragging all underwear layer clothing on the character and giving each Hotspot, Polygon Collider and Sprite Fader. Then I created OnStart cutscene and inserted Object: Fade sprite functions to fade out each and every sprite immediately. After that, if you drag right inventory item to it, it's sprite appears with Object: Fade sprite - fade in.
I am not sure if this is the most elegant solution and I would really like to know if there are any better ones out there.
Thank you in advance for your help.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I'm not totally clear on how you're handling the interactivity aspect, but on the topic of how things appear: the way I would recommend things be handled would be to rely on animation.
Rather than having each possible item of clothing be a separate sprite object, animation would allow you to "recycle" the same object for each clothing type - since you only need to show one of each type at a time.
For example, a "Shirt" GameObject could be used to display the current shirt, by swapping out which shirt sprite is loaded into its Sprite Renderer component.
With animation sub-layers, you should also be able to make use of just one Animator to handle everything.
The bulk of this approach just uses Unity's own animation system - AC would only be used to control which animation is actually shown. I would recommend reading up on Unity's Animator docs if you need an introduction to the animation system, but essentially:
Thank you very much, Chris!