Hi, I'm using an addon in Unity that doesn't support Playmaker. I'd like to know if there is a way I can listen or somehow interact with this addon through the inspector. Can I listen to the scripts this addon is running? Or can I add a component to the GO so I can get some control from Playmaker? I know with the proxy we can have certain control over some events but I'm not sure how far I can go.
Thanks!
One way to access any component is to drag and drop that very script to the state panel (where you place actions). It should then ask you if you want to get or set something. This creates the get/set action. Next, you have to find the right
property in the dropdown, and configure it.
You can also create an object variable in variables pane, configure it (navigate a few dropdown list), and then use this. It’s a bit counter-intuitive how these things work, at first, but not for long (try the drag and drop first). Think of objects as blueprints, a variable that stores the blueprint of a house, and the concrete house (using that blueprint). Code is very picky about that. After all, you can’t open the door in the blueprint, only in the actual house.
Any approach that relies on dragging and dropping relationships around across the scene is prone to break once the object is removed from scene. To fix this, Jean touts a tool called
Linker Wizard.
When you need to set/get something often, or you’re about to pepper all your FSMs with it, I recommend to write a custom action. It’s not as intimidating as it seems, and setting or fetching stuff from scripts is doable. There’s a tool to get you started (playmaker > tools > Custom Action Wizard), and e.g. MDotStrange made several posts (and videos) about this, which are very beginner friendly. I also see other videos on YouTube (search for “custom scripts” playmaker).
Good luck