1

In SpriteKit, it's possible to move nodes by directly setting their velocity property.

This doesn't seem to work in SceneKit, however. Setting velocity -- both in game loop callbacks and outside of game loop functions -- seems to have no effect.

This answer from one of the Apple SceneKit engineers suggests accessing the velocity property is only possible during a game loop callback like updateAtTime.

So clearly there are limitations around the velocity property.

Is controlling the property directly not possible with SCNNodes?

4

1 回答 1

1

正如@Confused 所指出的,文档显示可以velocity直接设置:https ://developer.apple.com/reference/scenekit/scnphysicsbody/1514757-velocity

关键是使用动态的身体类型,而不是运动的(显然不是静态的)。

于 2017-01-29T22:47:42.443 回答