0
\$\begingroup\$

I wrote a script that would match all models to one size, no matter the original size of the source model. So now these models fit precisely in the scene, but unfortunately when I add SCNPhysicsBody to them (with SCNPhysicsShape), their colliders (shapes) are not scaled. They do not match the current size of a node.

How can I fix this?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

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

But you can force to use the new scale.

Just create a physics body with nil (or null if you are using xamarin ios) for the shape parameter.

E.g.:

body = SCNPhysicsBody(node, nil)

or for xamarin ios

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .