Doors are my nightmare, but
apparently I'm not alone!
I have a very particular issue, though, doors in my game are physics-based, and sometimes I want to stop the door from opening fully: either when the player is in the way, or when an object is in the way that the player has to move (like a heavy box).
Currently I have my doors on a basic switch system: the player simply left-clicks on them to open or close them, which takes place through a moveable -> set track position action, after checking its current state (open/closed) through a boolean variable.
Essentially I'd need a way to say "hey, door, you've hit something solid. Stop trying to open or close." Currently the action will attempt to complete no matter what, and produces a jittering of the door as it repeatedly slams into the blocking object or player. Does anyone have any advice as to how I could resolve this?
Thanks!
Comments
The problem would be figuring out the best way to define what Collider type should stop the Draggable from moving. It should be simple and intuitive, but not restrictive. I'm open to suggestions or thoughts on this.
going to occur/behave only according to that. This means you can still
use e.g. Physics Materials to get the "bounce" effect right, and tweak
Unity's Physics settings so that different layers ignore each other.
In
other words: AC won't interrupt an object's movement in the physical
sense. But what we can do is say "if this type of collision has
occured, then stop trying to move it along the track".