-
-
Notifications
You must be signed in to change notification settings - Fork 992
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Interaction): force stop interacting on object when disabled
The Interactable Object script will now sever any interactions if the game object is disabled. So if an object is being touched, grabbed or used and then disabled, all of these interactions will be cancelled. This means when the object is re-enabled it will be dropped as it is no longer being grabbed for example. This interaction server is a public method on the Interactable Object so other scripts call call `ForceStopInteracting` on an object to auto force interactions to end. To accompany this, two additional cancel interaction methods have been added to Interact Touch and Interact Use: * `ForceStopTouching` will cancel any touch that is taking place. * `ForceStopUsing` will cancel any use action that is taking place. The Interactable Object will also check in it's `Update` routine to see if it is still active in the hierarchy and if a parent is disabled then the `ForceStopInteracting` method is called.
- Loading branch information
1 parent
a219347
commit 7820b53
Showing
4 changed files
with
89 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters