miskatonicstudio / goat

Godot Open Adventure Template (GOAT) is a tool for making 3D adventure games.
MIT License
363 stars 32 forks source link

Highlight and align an item held in hand #297

Open miskatonicstudio opened 2 years ago

miskatonicstudio commented 2 years ago

The feature could work like this: the highlighted version (possibly semi-transparent) would be displayed at a point where the raycast encounters any 3D object; then, if the encountered object is meaningful for the interaction (e.g. a door for a held key), the highlighted version would be aligned correctly (e.g. the key in the lock).

Alternatively, the highlight could be aligned always with the raycast collision point.

Another version is to not display the item's highlight, but instead use the item itself to start an animation (e.g. a key moving toward the lock that it's about to open).

Regardless of the final version, it has to work in the inventory as well. However, there is added complexity here, as the inventory supports drag and drop of other items. In that case, the drag and drop can either show the highlight if an item fits (e.g. a missing piece of a puzzle) or actually fit the matching item (without using the highlight) or skip any matches at all (if an item fits, we will know it only after dropping it).