Using Interactable in UIS With Interact in UCC

SteveC

Member
Hey y'all!

Per the integration demo scene for Ultimate Character Controller - Ultimate Inventory System, the demo pickup items/shops all use Interactable and are triggered when the character enters. I'd like to be triggering stuff when the character selects it... the ol' "Press [F] to OPEN".

Lookin @ this doc page:
... it's a bit shy on details.

How can I accomplish that using an Ultimate Character Controller character?

Thanks much =)
 
UCC and UIS both have an interaction script/ability.

In the integration demo, most of the item pickups use the UCC interactions and are set as pick up on trigger. That is set up directly on the pickup. You can toggle that off. The button to press is defined by the interact ability on the chacater.

When interacting with UIS interactables (in the integration demo that would be the shop, chest, crafting stable) then you can choose the button to press on the Inventory Interactor component (it is on your character). It's a button, not a key. If I remember the button that maps to the 'F' is "Action"

Let me know if you have any other questions
 
I am using Ultimate Character Controller 2.2.4 and Ultimate Inventory System 1.0.6.

I have added the "Interact" ability to my UltimateCharacterLocomotion as shown here.

However, I find that only "Opsive.UltimateCharacterController.Traits.Interactable" responds to the "Interact" ability.
The "Opsive.UltimateInventorySystem.Interactions.Interactable" just activates in Trigger Enter regardless.

I would appreciate a demo or sample code/screenshots on how to make the chest respond to the "F" button instead of just responding to trigger enter.
 
As of right now you can set an input button on the InventoryInteractor component. The inventory interactor sits next to the Inventory component on the player usually
1602149326549.png
Note that this is a place holder solution until we find a better one in a future update. For example this won't work with Rewired or the new unity input system.

The change will most likely come with v1.1 later this year
 
Thank you.

I used the "Action" input button defined in the project input settings. Works like a charm :)

However, I don't get the UI prompt from the Ultimate Character Locomotion "Interact" ability. i.e. "Press F"
It appears that at this time the "Interact" ability and the InventoryInteractor are unaware of each other.
tempsnip.png
I guess I just add some world space UI component as a child of the player gameobject and assign it to InventoryInteractor.InteractableIndicator?
 
Yes the UIS and UCC interaction system are completely unaware of each other. One requires a character controller the other requires an inventory. In the future we may look into a better solution for the integration. But it's not a priority right now.

Yes in the Invetory Interactor script you can see a "Interactable Indicator" field. The gameobject you set there will be set active each time the interacter can interact with something.
 
Thank you.

I used the "Action" input button defined in the project input settings. Works like a charm :)

However, I don't get the UI prompt from the Ultimate Character Locomotion "Interact" ability. i.e. "Press F"
It appears that at this time the "Interact" ability and the InventoryInteractor are unaware of each other.
View attachment 4048
I guess I just add some world space UI component as a child of the player gameobject and assign it to InventoryInteractor.InteractableIndicator?


Hi,

If it helps like Sangemdoko says.

You can :

- Create a UI Text on the player and drag it into "Interactive indicator"
1602768801974.png

- For deactivated at the time of interaction. You can put it in an event. In my example it is the shop
1602768842012.png
 
Hi,

If it helps like Sangemdoko says.

You can :

- Create a UI Text on the player and drag it into "Interactive indicator"
View attachment 4082

- For deactivated at the time of interaction. You can put it in an event. In my example it is the shop
View attachment 4083


I tried to leverage the existing Message Monitor as the Interaction system does to update the 2D UI. That didn't work because it was fighting the existing implementation and created unwanted behaviour :(

In the end this worked for me:

1. Duplicate UI
  • I duplicated the "Messages" gameobject and renamed it "MessagesFromInventoryInteract".
    NOTE: That way it occupies the same size/position of the screen that the Interaction system usually uses
  • I removed the MessageMonitor script from "MessagesFromInventoryInteract" gameobject
  • I made the MessagesFromInventoryInteract gameobject inactive by default
    Messages.JPG
2. Update Player's InventoryInteractor script
  • Assigned the new "MessagesFromInventoryInteract" gameobject as the InventoryInteractor.InteractableIndicator on the player's Interactable script
Interact.JPG


It ain't pretty, but it works and it's clear so I can rip it out if this integration gap is plugged in a later version
 
Thank you for sharing your solutions.
I'll make sure to keep you posted when we upgrade the interaction system for the integration. Unfortunately as mentioned before it's not a priority right now, between the work on UIS v1.1 and the 3rd party asset integrations I think I will be extremely busy for the next few months
 
Top