Hi,
I need some help today and I hope someone will be able to help me to resolve my problem.
I'm making a game with a snowman and the player will have to find the four buttons of different colors to put on the snowman. So I put in my scene the buttons that have to be find and I created the objects on my snowman and made them invisible on start.
I then created the hotspots on them to make them visible if the player put the correct colors button on it. That works fine.
However, I want my snowman to have a key appearing in his hand if the four buttons are put correctly. Here comes the problem. If I make the interraction Object : Check visibility and then make the key appear it works, but only if I check one object.
I'm I missing something?
Please help me out
Comments
Go with variables, once one of your buttons placed correctly add one digit to your variable and check if your variable is equal to 4 if it is set visibility of your key on.
Also, without seeing what your puzzle looks like, if the player takes out/cahnges the correct buttons from your puzzle reduce your varaible by -1 .
The "Object: Check visibility" Action, checks whether or not the Renderer component on the object you check is enabled or not - so make sure you assign your object as the same one as the SpriteRenderer / MeshRenderer and not a child/parent.
For instance you have a quest log that has a quest "Your awesome buttons puzzle quest now - completed" or not completed. Then in another scene when you open your quest log you check your buttons variable and if it is true or meets your digit 4 or whatever your varaible is defined you call your quest completed.
Otherwise use local varaibles.
Regarding the Object: Check visibility it's also viable, specially for a local, isolated case. In fact it is like a local bool variable.
Only don't forget to add Remember visibility component to all those buttons that you set visibility on and off, so when you come back to the puzzle scene or load your saved game your buttons visibility states are remembered.
No, you create hotspots and interactions( interactions are your actionlists), you link those interactions with your hotspots. In hotspot's inspector Use interactions.
I don't add hotspots or interactions (actionlists) components to my game objects(sprites, 2d animations or characters). I prefer to keep everything separated so I could manipulated with freedom, for instance I might wanna remove my sprite for good but want to keep my hotspot and so on with other things.
In fact actionlist, interactions, custscenes are all the same things, at least is what I think, since they do the same things (run your actions) and it is only a matter of how you call some of them like Onload or OnStart cutscenes and still they are actionlists that follow actions you create in them, you can also change whatever Onstart or Onload cutscene-actionlist to run in the AC Scene tab. So I just call it all actionlists. Sorry about this long rant
"Should I put all the buttons as child of the snowman?"
Actually we don't know what your snowman looks like. Is it an NPC, a moving Player character, or an animated sprite that moves around? Then you'd need to child whatever graphic elements you put on him.