Reputation: 547
Ok, I am not home right now so I can't post any code BUT here is the situation. In my app, I have a ball shoot to where you tap and it works fine on the desktop computer but when I use it in TestFlight on my iPhone, there are 2 problems, the first is that the ball never rests on the ground, when it falls into the scene it never stops bouncing, the other problem is that when I am using it on my phone, if I quickly tap and release it is fine but if I hold down on the iPhone screen longer, the ball shoots up way way way to fast and too high.
I use applyImpulse() to shoot the ball. I have no idea why its not working because it doesn't do this on the Xcode simulator. I HAVE NOTHING IN MY GAME that will make the ball shoot higher or lower depending on how long you touch, my theory was since the ball won't stop bouncing, holding longer in my game DOES increase the restitution (the range is from 0.5 to 1.75) but it never messes up on my laptop so I am really confused. Any help is appreciated!
Upvotes: 1
Views: 96
Reputation: 59
Just use applyForce, because simulator has something different with implementation.
Upvotes: 1
Reputation: 196
You can try to use the linearDamping property on physicsbody to slow the ball down.
Instead of useing applyImpulse, use applyForce: applyForce works for just one frame, the impulse can be used for a duration to accelerate an object.
Upvotes: 1