Unity VR ball goes through racket issue

I am trying swing a ball with a racket, and the interaction doesn’t feel well, I can’t even swing the ball as when I try to do that the ball will just go through the racket.

Here’s a video that demonstrates the issue:

Here are my settings for the ball:

for the racket:

Here are my physics settings (I have already set the penetration velocity very high):

I have also set the timestamp very low

Two things to check:

  • Be sure you only move or rotate ALL rigidbodies using the Rigidbody API

  • Be sure you enable continuous collision on all rigidbodies.

More reading:

With Physics (or Physics2D), never manipulate the Transform directly. If you manipulate the Transform directly, you are bypassing the physics system and you can reasonably expect glitching and missed collisions and other physics mayhem.

Always use the .MovePosition() and .MoveRotation() methods on the Rigidbody (or Rigidbody2D) instance in order to move or rotate things. Doing this keeps the physics system informed about what is going on.

With a wheel collider, use the motor or brake torque to effect motion.

1 Like

I have checked them all and they seem to be alright

Bump

I have recently considered the option that it might be due to the refresh rate of the oculus controller. I tried to slerp the racket between two frames to smoothen the racket, but it didn’t fix the issue.

You could try setting the racket to “ContinuousSpeculative”.

I tried, it didn’t help much. I’m starting to think that the physics engine isn’t fast enough to find the colliders as I have tried every single option in the physics engine. Perhaps I should use raycasts to find collisions and write my own physics…

Hi,

Perhaps the size of the racket collider is a little too small.
Have you tried other sizes of the collider?
For example Y 0.031. Is it the thickness of the racket strings?

And isn’t the weight of the tennis ball little to high?
The mass of 1 kg is about 2 lbs.

I was having problems with a VR controller tennis racket swinging at a ball and this fixed my problems. Works perfect now after updating the racket position using rb.MovePosition() and MoveRotation()

I would also add: Make sure your rigid body Collision Detection setting is set to Continuous-Dynamic on the swinging object and set to Continuous on the ball.