Closed fight4dream closed 2 years ago
can you raise this as a bug with steps to reproduce as it seems there is an issue where you cannot do this if the objects aren't already in the scene
follow the guide up to step 7 where we are asked to drag in the corresponding Interactors. but if the sword is made into a prefab waiting to be instantiated. there is no Interactors that can readily be dragged. the interactors are needed to be found in runtime
So this is possible to do with the Rules Matcher, but having a base generic way of it working may be a bit tricky.
I'm not sure if its best to provide a rules matcher way in the prefab with an option to toggle it, or provide a guide on how to set it up
rough guide is:
Create the 2 orientation handle gameobjects (for left and right)
Create a rule that determines left controller (e.g any tag rule)
The Matched()
events for each rule element then sets the TargetOffsets
element to the manually provided orientation handle.
Interactable -> Internal -> GrabLogic -> ActionContainer -> GrabAction.Follow -> Processes -> GrabProcess -> SetupFollow -> GameObjectEventProxyEmitter
- Change the middle event (OrientationHandles->GameObjectRelations.DoGetValue)
to the newly created Rules Matcher Match
method:
This will then call the rules matcher on setup follow, which will in turn match the correct controller based on a rule and therefore set the correct orientation handle at runtime.
I've added a feature to this PR:
https://github.com/ExtendRealityLtd/Tilia.Interactions.Interactables.Unity/pull/132
:tada: This issue has been resolved in version 2.7.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Is your feature request related to a problem?
The current way is through the GameObjectRelations component. Basically it is like a GameObject rule that map from interactor’s game object to the orientation handle. But it is not flexible when dealing with interactable objects (prefabs) that is instantiated or when the interactors are not initially in the same scene.
Describe the solution you'd like
We shall be able to use rules such as AnyTagRule or AnyTypeRule to identify the mapping. That will work for instanced objects as well as interactors.