UCC with Playmaker - getting interact action in UCC working as trigger for Playmaker FSM states

hd177

New member
Hi there,

I've been dabbling with the UCC for a little now and have hit my first major roadblock. UCC is excellent but also incredibly complex for a more visual art / designer person, so I opted to grab Playmaker and try out basic visual scripting. I can tweak UCC and I can make stuff work with Playmaker independently, but I can't figure out a way for them to meaningfully interact - even with the integration - in the simplest of cases.

For example;

I've got a character setup with the interact action, and have done the tutorial getting the platforms moving (all good here!), but when I want to make a simple light switch that turns on or off a lamp, I can't figure out how to hook into the Interact action from the controller with Playmaker. I've searched for answers here and see recommendations for things like the "Set or Stop Ability" or "Is Ability Active" actions, but I can't seem to get any of these actually triggering on interaction (the interact action IS working as it is active while executing the animation).

Any advice?

Thanks
 

Attachments

  • image-20220508-083630.png
    image-20220508-083630.png
    308.4 KB · Views: 4
Okay, I figured it out after a lot of trial and error!

Use "Is Ability Active" -> Interact and select the character controller + "every frame" so it's regularly checking. Though I assume that's... not great from a performance perspective? Every item doing this check constantly?

The next issue I hit in the light switch example is that the interact action is "active" for 1-2 seconds while the animation plays, and that throws the FSM into an infinite loop. I had to add a wait/buffer state between the off and on states to ensure it didn't loop and crash over and over.

One thing I haven't figured out is how to make it detect the interact action on this particular gameobject. Right now it's detecting any interact action anywhere and turning the light on and off, which is obviously less than ideal.
 

Attachments

  • image-20220508-083630.png
    image-20220508-083630.png
    308.4 KB · Views: 1
The Playmaker integration doesn't have the functionality to be able to implement the interactable interface so the basic actions won't really help here. This is a great suggestion though and I've added it to my list - I'm kind of surprised that it has been four years and nobody has suggested this. For now though you will need to create a custom interaction with scripting:


With that said, your approach of checking if the ability is active will work but it will not implement the actual interaction. For that you need to implement the interface.
 
Thanks, Justin! I was a little surprised I couldn't find this anywhere too haha, I can't be the first person to try to get the interact action working as a trigger for Playmaker. Happy to dig into it myself, but could you point me in the right direction for "implement[ing] the interface"?

If I were to ditch Playmaker, any guidance on how to get that simple light switch working? I'm guessing a script on the Lamp object that hooks into the UCC, detects the interact action, and executes some kind of standard ActivateGameObject statement. I can get the basic light on/off working without too much trouble but am struggling to know where to add it / how to hook it into UCC interact.
 
In the middle of the Interact page there is a section on the IInteractableTarget - it's here that you'll need to implement a new interface. The AnimtedInteractable component provides a good example, it implements the two methods required and is a fairly small component.
 
Top