Help with Interaction scripts

Vlaxep

Active member
I've just implemented the 'Interact' ability and my setup is a button similar to the video tutorial, except rather than opening a chest, I simply want to activate a Canvas (I can handle the rest once this becomes active)

I'm a bit confused as to how to implement this (not a coder, but good with 'Bolt' Visual Scripting).

The hover tooltips in the 'Interactable' script component seem to suggest that the End Target Object (my canvas) that I want to activate should use the 'IInteractableTarget' script - but trying to add this script gives the error: 'Can't add script component 'IInteratableTarget ' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match'

So:
1) What does that 'IInteractableTarget' script do and how is it meant to be used? Or do I not need it?

2) Secondly, I believe I can easily just run a check on the Bool toggle in the 'Animated Interactable' script component to check for TRUE/FALSE and script the 'activateCanvas' from there, but I feel like there's a UCC built-in way to do this? I'd prefer to use that if it is there rather than adding operations that aren't necessary....

3) Thirdly any ideas on fixing that Script error? I feel like I should definitely be using this script on the Canvas object....

FYI currently this is what is working:
- Player character enter's trigger collider of ButtonStandObject
- 'Press F to Use' prompt and Icon show correctly
- PRessing F/Action works as expected and Player 'Move towards location' works great too!
- Audio plays as expected

So all is working fine! I just need to know best practice from here to simply tell a GameObject to become 'Active'

Cheers,
Vlaxep
 
Getting closer on discord, can anyone confirm?

- 'IInteractableTarget' script is not something I attach to an object?
- It is in fact a script that creates an 'interface' that creates a relationship between two other scripts to communicate regarding particular variables/information?

Even so, I'm still wondering whether there is an inbuilt UCC solution to turning this interaction into a simple 'Activate' / 'Deactivate' function for another gameobject ie. Player Presses button > GameObject is activated.

I'm a Non-Coder, so if this requires any coding that's not already in UCC, or beyond 'basic' I can very easily trigger the 'active' of the GameObject by using Bolt Visual Scripting - just prefer to use what is in UCC before I go outside of the pre-made functionality!
 
Ahhhh I think I've got it, crikey! So I was a little lost on how the Child Objects within the Interactable Parent Object were receiving instructions on what to do.... Just realised it was simply that the animations were being triggered.... So in that case I would need to either extend the code or create a new script. In my case checking the 'interact' bool parameter should be the simplest method for me to access the interaction state to perform the operations I need. Thanks so much for your time @dlich and @DankP3 !!

DUH! Or I could create animation for my Canvas to Alpha=1?

I'll mark as solved anyway!
 
Top