Hi, I'm aware that the only way I can call an ActionList with Parameters from a Hotspot (in the inspector) is if the Parameter is a GameObject and I attach the Hotspot itself as this gameobject, so I'm trying to do it through script, but I'm new to this side of AC so I'm not sure how to properly do it.
The situation is I'm making a pc screen where the player can interact with the files in the computer, so I designed a folder maze where the player opens a folder and there are more inside, and then more inside those ones. The point is, there are A LOT of folders, let's say 200. This means that there's 200 hotspots that each have to trigger an interaction where another folder opens. My idea was to create an actionlist (OpenFolder) that handles all the cases in one, for this I added 3 parameters: the previous folder's hotspots (grouped in 1 parent hotspot), the new folder's hotspots (also grouped) and the new folder's assets (also grouped in 1 empty gameobject), so 3 gameobject parameters, none of which is the actual hotspot we're clicking, that one is inside the previous folder's hotspots group. This actionlist first disables the parameter 0 hotspots, then enables the parameter 1 hotspots, and finally makes the parameter 2 assets visible using Object:visibility. The problem is... how do I call it?
I thought about making a script that receives these 3 gameobjects from the inspector, as well as the actionlist to run, then sets them as parameters and then runs the actionlist. I was trying to do this but then ran into the obstacle of not knowing how to call this function from the hotspot. I thought, well, maybe I can attach a small actionlist to the use interaction that does "object: call event", but that forces me to attach a gameobject to the action (which would mean making a separate actionlist for each folder, I was trying to avoid that, I don't want to make 200 actionlists, that would defeat the purpose of this whole idea). I thought about using an OnHotspotInteract event but same problem with the object: call event. Is there a way to call the function without resorting to making separate cases for each folder?
Maybe there's a simpler solution and I haven't thought about it.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
There's another way. If you attach the Set Interaction Parameters component, you can configure the values of all Parameters associated with the chosen Hotspot interaction.
Omg how did I miss this, I'm sorry! Thank you