Open & Close Interaction

atmuc

Member
In the interact tutorial video, there is only open chest interaction. How can I add additional close interaction? I need that multiple-state interaction for sitting on a chair.
 
If you want to sit on a chair, you might rather implement it as an own ability than using the interact ability. Interactions are more thought of having a finite / short duration like pressing a button. With a sitting ability you could have all animations within this single ability, and trigger them according to starting / stopping the ability.
For the chest it would be different.
 
If you want to sit on a chair, you might rather implement it as an own ability than using the interact ability. Interactions are more thought of having a finite / short duration like pressing a button. With a sitting ability you could have all animations within this single ability, and trigger them according to starting / stopping the ability.
For the chest it would be different.
Sorry, My question was not about how to make sitting ability. I need multiple state abilities like closing an opened door and opening a closed door. examples are a single state like open a closed door. after I open a door how can I close the same door using interact ability (buildin or custom)
 
I need that multiple-state interaction for sitting on a chair.
Sorry, I thought this was the request ... On the character you need to interactions, one for open, one for close. These are different interactions. Then you need two Interactable components on your chest with different IDs, also two different Animated Interactable components that you assign as targets to the Interactables. Lastly, you need to implement two IInteractable components that you also assign as targets. These components need to keep track of the state (open/closed), and ensure that only one of the components returns true for the CanInteract() call, depending on the state. You might use an event to share the state between these two components.
 
Top