Hiya, using Unity 2018.2.2f1 and AC 1.64.1. Big fan of AC and would love input on my latest roadblock
My problem is two part: I have the player pick up a couple food items, combine them to make nachos. 1. When the player leaves the scene and re-enters, the items are all back in the kitchen. 2. When I try to turn off the item's hotspot, either via code or via Remember (using state on start: off), the hotspot remains on.
Few things are weird about this situation (and info about my setup):
- It used to work, which makes me wonder if an update changed things?
- I tried using the api for disabling and enabling hotspots (e.g. even for picking up an item) and that doesn't seem to work. Sample code: obj.GetComponent<Hotspot>().TurnOn(); so as a temp solution I use SetActive() (only works for enabling/disabling the object on pickup, does nothing for the re-appearing on scene load)
- I have a lot of checks around each item, for example if local variable nachosMade is true, don't show these items. The local var nachosMade saves and is consistent on scene re-load, but the items still load. An example of that code:
switch (obj.name){
case "Cheese Block":
if (AC.KickStarter.runtimeInventory.IsCarryingItem(3) || AC.LocalVariables.GetBooleanValue(2)) {
break;
}
obj.GetComponent<Hotspot>().TurnOn();
obj.GetComponent<SpriteRenderer>().enabled = true;
break;
- I have remember hotspot and remember visibility and constant ID on each item. The default is set to "on" for these, so maybe this is where I'm going wrong? Does this default overwrite things that happen OnStart?
Any input would be greatly appreciated! I feel like I've been going circles on this one and it's gotta be something more simple than I'm making it into...
Thank you again
Comments
So that we can ensure no conflict, remove all custom code that's turning the Hotspot on/off - for the moment, just rely on using the Hotspot: Enable or disable Action to affect its state.
1. Mac platform, I honestly haven't tried building it but I will next so I've only seen it in the editor.
2. Just remember hotspot, remember visibility works as expected.
3. I updated Unity and AC at the same time Was on Unity 5.6.6 before (I forget the version of AC but I kept that better updated)
4. Leaving/re-entering with code:
6. Uhh I also haven't tried save/load functionality, I'll do that next with the build.
Thank you for the suggestions! I'll update in the next day or so with how the build and save/load goes.