Hi everyone,
I'm struggling to wrap my head around what I thought was a simple challenge: I want to be able to lock certain doors (hinged moveables, created by following the AC tutorial) (and probably also drawers at some stage) to prevent the player from opening them.
I've positioned a hotspot around the door mesh and made it the child object of the draggable, so that it rotates with the door. I can use this to trigger a use event: something like "play dialogue about locked door, then set the track back to 0 position", but the player can always wiggle the door open with some creative clicking.
In short, I suppose something as simple as being able to enable and disable the moveable would be what I need, or being able to set the max speed for the moveable at runtime (toggling between 0 and 200, for example). Does anyone know how to do this?
Thanks!
Comments
2) I don't know what you mean by "click blast", but if de-parenting the Hotspot works then I'd recommend doing that. Adding colliders in parent-chains in Unity causes them to contribute to parent Rigidbodys etc, so you sould keep them separate if possible. A simple script attached to the Hotspot could keep it's position relative to the moveable object, making it appear parented in-game.
However, know that you can also assign an "Interaction on move" ActionList to your Moveable that runs whenever the player controls it. This has to be a non-blocking Interaction (set to Run In Background in it's properties), so that it doesn't interfere with gameplay. But in it, you can do a Variable: Check to see if the door is locked, and then run a new ActionList that closes the door and gives an "It's locked" response.