#7 implementation grabbing between obstacle and character : improvement
Related #7
Modify the grab interaction logic
- add
left/rightHandContacted
flag in Character which indicates the contact status with an obstacle. - The contact logic is separate from the button pressed
- grab button is pressed -> contact status of each hand is checked
- trigger grab interaction on character corresponds to hand's contact-status.
I'm not good at control the character with a motion sensor, so please test grab interaction once on your side.
Merge request reports
Activity
changed milestone to %Joystick & control
added Basic functionality Doing labels
Now we can trigger grab in two cases:
-
when the hand is already on the obstacle(contacted), press grab button to trigger grab interaction
-
when the hand is not contacted but users first press grab button, and then the hand makes contact with obstacle, then grab interaction is triggered.
I think the second case was not intended by my previous code
-
added 1 commit
- 3d49aeea - add the case if button already pressed, contact can trigger grab
added 1 commit
- 90c8bfb6 - code cleaning: make repeated code as a function
mentioned in commit d967a826