Open Fairennuff opened 2 years ago
Is it fair to say:
You can only grab with another pointer grabber if the object is not already grabbed
or if it is already grabbed then the interactable's secondary action is of type "Swap"
IMO the expected behavior would be: If the object is grabbed and has the secondary grab type set to swap - a distance grabber can still detect/grab it. If the object is grabbed and has the secondary grab type set to none - no distance grabbers will detect/grab it.
There is a simple enough solution to have a behavior enabled rule on the grabbers to look for a tag on the objects you want to perform like the latter - it gets enabled when grabbed and disabled when ungrabbed. Then you add the rule to the distance grabber. Object is picked up, behavior is enabled, object no longer falls under target validity. Which is why the rules system is so awesome!
but in the end this is sort of an expected behavior of how the component should work.
yes, but what if the secondary grab action is control direction?
At the moment the distance grabber would probably go a bit wonky if you tried to distance grab to the secondary grab.
So my suggestion is:
if you're already grabbing an object then it will only distance grab with the secondary controller if the secondary action is swap and nothing else works.
Oh I wasn't taking into account the other grab action types! Yeah I agree - only distance grab if the secondary is Swap. All other secondary types should probably be not grabbable via distance grabbers.
Thinking about this, the distance grabbers aren't actually working as primary/secondary grabs
They only ever work as a primary grab.
So if you're holding something and you distance grab with another controller then that distance grabber will force an ungrab and then perform the primary grab action again.
Because in taking the secondary grabs into consideration, what does this do for the touch events?
If the secondary grab is not swap, then should you even get the touch cursor of the distance grabber?
To me, it would feel more broken if the cursor just stopped working.
I actually now think the current way of working is the expected way, as long as its understood that the distance grabber always initiates the primary action and secondary action has nothing to do with the distance grabbers.
That's fair enough. I didn't know they always used primary grab. As mentioned I just used the rules system to ignore held objects in some situations to get the interaction I wanted. So it's still perfectly doable using Tilia components.
Just as a an example of why this is probably a common need though - in my case I have a radio interactable object with lots of controllables tied to it (antenna, tuning knob, volume knob). If secondary grab or the distance grabbers were able to grab the radio then half the time I went to grab one of the controllables I'd just grab the radio instead. Any reasonably complex interactable (rifles, fishing poles, etc) would probably suffer from this behavior and need to have a work around. But like I said - the rules system does the job just fine here.
Yeah I wonder if this is solved with a how-to guide to show how to achieve this solution
Environment
Steps to reproduce
Add an interactable to the scene and set secondary grab to none. Add a distance grabber to both aliases. Grab the object and then hold it out and point at it with the other controller - the distance grabber indicator will appear and you can initiate a grab.
Expected behavior
Distance grabber will not activate on already grabbed objects - specifically with their secondary grab set to none.
Current behavior
Distance grabber is able to grab an already grabbed object, even if secondary grab type is set to none.