Applying simple Physics to a .scn object in SceneKit XCODE SWIFT

半城伤御伤魂 提交于 2019-12-02 11:07:49

Check to make sure that your characterTopLevelNode is actually the node you think it is (name mismatches are pretty common). That's often the problem in these kinds of situations. You seem to be adding the characterTopLevelNode as a child of node but never adding node as a child of the scene being displayed.

One other thing, don't set the options on the physics body before you create the physics body.

For example: sphere1.physicsBody = SCNPhysicsBody(type: .Dynamic, ... sphere1.physicsBody.affectedByGravity = true sphere1.physicsBody.friction = 0 sphere1.physicsBody.restitution = 1 sphere1.physicsBody.angularDamping = 1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!