01-17-2023 07:32 AM
01-23-2023 04:24 AM
1. You could set the object as a child of the hand transform, thereby having it follow the movement of the hand despite having released the grip button.
2. Instantiate an object and use the hand transform as a parent. If you want the hand to hold the ball properly I suggest looking at the Handgrabpose examples
01-24-2023 10:55 AM
Hello,
i tried to attach my object(that could be a simple cube with rigidbody and collider) to the RightControllerAnchor as a child, however I have these problems:
if set "uses gravity" on rigidbody, the object keeps falling to the floor
if i remove the gravity i can move it but it flies in the air.
if I set only kinematic the object is perfect, it follow my controller movements but the collide with other objects doesn't work anymore.
last test: if i add to my object a fixed joint and as body i select the hand right controller, then it works but my entire body with the camera rig is being pushed around by gravity.
So at the moment i can't find a working solution.
Thanks
01-25-2023 03:01 AM
Is the Collider a box collider, or mesh collider? Is it set to convex? Sometimes that is needed for collisions to work properly. When listening to a collision event do you use OnCollisionEnter or OnTriggerEnter?
01-25-2023 09:28 AM - edited 01-25-2023 09:29 AM
Hi,
tested both, box collider or mesh collider + convex, same behavior,
My test is very easy, i don't use any onCollision Event,
i simply attached a cube to the controller.
The cube attached to the controller when collide with the sphere, is not the sphere to move, is the cube that non remains attached to the parent controller
01-26-2023 05:51 AM
I'm lost. Do you want the sphere to move and not the cube?
01-26-2023 07:26 AM
I summarize it like this:
I would like to have a racket that has a rigid body and therefore can hit a ball.
But I don't want grab it and hold it with the grip button pressed all the time.
Hence your idea of attaching the object, in this case a racket, (or a cube) directly to the parent of controller, however I can't do it as the object flies away, it doesn't stay attached.
01-26-2023 11:52 PM
Ok, try this.
If you put rigidbody with is kinematic and gravity is set to false on the cube that is child of the hand object, try to freeze position/rotation in the constraints section of the rigidbody. If you put the rigidbody on the sphere as kinematic and not using gravity you should now be able to move the sphere by "pushing" the cube against it. If you want the sphere to fly away I guess you would want to activate gravity when collided and tweak the mass and physics materials.
I think you might have better luck in finding answers regarding this on the unity forums as this is a heavily Unity based question rather than Oculus.
Hope that helps
02-07-2023 07:56 AM