0
\$\begingroup\$

I wrote a script that would match all models in one size, no matter the original size of source model. So now I have these models fit precisely in the scene, but unfortunately when I'm adding SCNPhysicsBody to them (with SCNPhysicsShape) - their colliders (shapes) are old-sized. They do not match the current scale of a node. How to fix this?

\$\endgroup\$
0
\$\begingroup\$

The problem is that SCNPhysicsShape and physics generally in SceneKit does not actually respect node scale. It would not use new size, instead it will create SCNPhysicsShape respecting the old size of node.

But you can force to use new size.

Just create physics body with nil (or null if you are using xamarin ios) in terms of shape.

E.g.:

body = SCNPhysicsBody(node, nil)

or for xamarin ios

body = SCNPhysicsBody.Create(node, null)
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.