So, I am developing a game using SpriteKit. And to make the game more interesting, I decided to use UIDynamicAnimator to add some physics to the UIKit elements in my game. Everything works fine except for one serious problem. At that moment, when I select / initialize the UIDynamicAnimator as follows:
animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view];
The physical bodies in my game are fully compensated. Even if I do not specify a reference view, physics will still be biased.
What is strange is that I create a UIDynamicAnimator in a completely separate ViewController, so it doesn’t like that it uses the same reference view or something like that.
Update . Even the action of simply creating a UIDynamicItemBehavior:
UIDynamicBehavior* a = [[UIDynamicBehavior alloc] init];
ruined the physics of my scene.
I assume this is an internal error with the physics engine that separates SpriteKit and UIDynamics.
Anyone have any suggestions?
source
share