Group Group Group Group Group Group Group Group Group

Chapter 6. Dice falling through the plane

#1

Hi,

After implementing Plane physics in Chapter 6, very often dice falling through the plane or several dice falling through the plane and several stayed on the plane.

It also happens in final tutorial project .

#2

@chrislanguage Can you please help with this when you get a chance? Thank you - much appreciated! :]

#3

Issue can be fixed using of continuousCollisionDetectionThreshold:

For example, in a game involving projectiles and targets, a small projectile may pass through a target if it moves farther than the target’s thickness within one time step. By setting the projectile’s continuousCollisionDetectionThreshold to match its diameter, you ensure that SceneKit always detects collisions between the projectile and other objects.

func throwDiceNode(transform: SCNMatrix4, offset: SCNVector3) {
   ...

   if #available(iOS 12.0, *) {
      diceNode.physicsBody?.continuousCollisionDetectionThreshold = 0.04
   }
        
   sceneView.scene.rootNode.addChildNode(diceNode)
}
#4

@sergeydi Thank you for sharing your solution - much appreciated! :]

#5

My solution is incorrect. It can be used only with spherical physics shapes.

So, issue is still unsolved…

#6

@sergeydi Do you still have issues with this?

#7

Hi, I still have issues with his. Redid numerous times and still fall through

#8

Ok, closed Xcode, delete app of iPad… had a snack to compose myself. Restarted and rebuilt now dice no longer fall through… no idea why but at least it works now.

#9

@zoran Really glad you sorted it out! Cheers! :]