[Feature Request] Simple (non animated) Interactable Script

DavidC

Active member
I see this brought up from time to time for things like in-game buttons that can be pressed by looking at them and pressing the interact key. The one script that seems to be applied to things that you can interact with in the demo (doors and chests) has a dependency on having an animator and animation. This script would be a template for other things like this button that require no animation or would have animation handled elsewhere.

This is the signature of the Animated Interactable
Code:
public class AnimatedInteractable : MonoBehaviour, IInteractableTarget, IInteractableMessage

There's another script called "Interactable" but it has a dependency on IInteractable which is only for animated interactable and moving platform.

I think it'd be a fairly easy script to do and include in the files. Basically, it just does what a door/chest does, but instead of animations, it just has a cooldown variable, a variable for how many states it has (like 7 if the button changes rainbow colors as pressed) and storage of this variable, and an event that it invokes that broadcasts the object, the button state/index being pressed, and an ID number. One button press increments the button state, and it loops when it reaches the end.

I'd write it myself, but I don't need it myself, and it would only be available to the people who found it, too.
 
Top