My website code stuff
I’ve been working on interactable objects as part of making the seed growing and tree warping work. Essentially, interactable objects spawn a custom interact trigger box around themselves with custom specifications. Alternatively, you can attach an interact trigger to the interactable and it’ll just use that one.
The interactable object listens to its trigger box which feeds it info such as when the player is in range and when the player interacts with it.
When you throw a seed, it’ll eventually come to rest and spawn an interact trigger. Standing in that trigger will cause the seed to have an outline and interacting with that seed will pick it back up.
Note that in the below gif, the purple box is just for debugging and represents the actual interact trigger.
What I still need to add is the ability to cast a spell on the seed once its done growing. Ideally, the player will cast out a vector which will look for a seed’s interact trigger. Then when you try and cast, you will send a message to the interact trigger in front of you, causing the seed to grow.
“Trees” are objects with a specific kind of interactable component attached. They have all the same functionality of a normal interactable object plus the added ability to turn its own collision off when the player enters it.
Once you’ve entered a tree, you have all physics disabled and hover within it with a view outside it. Interacting again will exit the tree.
Ideally, once within a tree, if you look at another tree’s interact trigger and interact, you should teleport to that tree. Once this step is done, tree warp will be fully prototyped.