PlayMaker Help & Tips > VR Help

Objects going through each other at high speed (bat vs ball)

(1/2) > >>

Odd_But_Awesome:
Hi all,

This seems to be a common issue and I have Googled many pages and while some have improved my situation (dontgothroughthings script) it is still an issue on my Rift.

Balloons drop and I swing the paddle - if at a moderate speed most balloons behave as expected and get tapped away. If I flick the controller to swing quickly the balloon goes through the paddle to varying degrees dependant on swing speed.


I have a paddle attached to my controller - I have tried fixed hinge, VRTK auto grab, direct parenting and get/set POS/ROT. Paddle has box collider and rigidbody as per image Paddle.jpg.

Balloon has capsule (tried sphere and same result) collider and rigidbody as per image Balloon.jpg.

Also tried with a basic Unity primitive box for the paddle and sphere of the ball - same result = pass through at high swing speed.

My Timestep is set to .01111.


I have tried very large (>2x mesh size) colliders and various combinations of gravity, kinematic etc.

I have also tested this with the VRTK legacy example of 0026 autograb sword scene and the Unity box primitive still goes through Unity sphere primitive.



What is the best way to detect hits of 2 rapidly moving objects and make them react like a bat vs ball would. I would think this is a common thing some developers would have run into in the past.

I have very limited coding knowledge and have relied on Playmaker for almost all my previous games construction. So I guess a solution using PM would be awesome, unless someone can point me to a script or plug in which will do the job.


Thank you for taking the time to read.
JG

jeanfabre:
Hi,

 unfortunatly, there is nothing inside PlayMaker that can address this, this is puerly a Unity physics setup issue I am afraid.

Have you tried to do raycasting every frame? if you check the signed distance between the ball and the bat, this will allow you to act when the distance changes sign.

 Bye,

 Jean

Odd_But_Awesome:
Thank you for replying Jean.

I feared as much. I haven't tried raycasting every frame. I thought that the dontgothroughthings script did something similar. I may have to investigate more.

Thanks again.

djaydino:
Hi.
Do you have a link to this "dontgothroughthings"

Thore:
Check Rigidbody set to continuous. Or, check this:


--- Quote ---From my testing what I can tell here is this (and I've verified in a demo scene)
Let's take several cases.
1. A projectile (discrete) travelling fast will go through a static wall (simply a box collider OR a mesh collider. Its not a dynamic object as there's no rigidbody.
To solve, we add continuous to the projectile - voila. Problem solved, no matter the speed.

Now let's take it a step further and add a dynamic object to the mix. In front of our static (ie no rigidbody, dont actually have to mark as static in 5.x) wall that our projectile hits we dangle a sphere on some hinge joints (we could prob also just drop a sphere there and on its rigidbody turn off gravity - but the dangling ball looks cooler)

Even though our projectile is set to continuous, it will go right through the dangling ball. We must set the dangling ball OR the projectile to continuous dynamic. Both have to be at least continuous and one continuous dynamic. The mesh collider here doesn't matter.

Bottom line - it works as I've described with mesh colliders or a box collider. My guess mesh colliders are mentioned as they are the most complex type of collider, but from what I can see this applies to all colliders (3d - haven't done any 2d testing here)
--- End quote ---

found here:
https://forum.unity.com/threads/collision-detection-discrete-vs-continuous-vs-continuous-dynamic.291818/

Navigation

[0] Message Index

[#] Next page

Go to full version