1

I was just wondering what the units are for the velocity of a physics body in sprite kit.

In my app I have a gravity of (0,-5), however when I print the velocity.dy of a downward moving sprite it jumps to -750 very quickly (the sprite has only moved halfway down iPhone 5s screen). What unit is this measured in? Also the gravity of (0,-5) means -5m/s^2 right?

  • I definitely can reproduce this, and others have made similar comments. The best explanation I've found is in this (unaccepted) answer http://stackoverflow.com/a/20036658/97337. SK Gravity does not appear to actually behave the way the docs say it does. It is significantly different from a -9.8N force applied every frame. – Rob Napier Mar 04 '15 at 00:43
  • That explanation makes a lot of sense! Thanks for answering my question! – Luigi Mangione Mar 04 '15 at 00:50

1 Answers1

0

Sprite Kit uses the International System of Units, also known as SI

So it's probably m/s (meters per second)

Choppin Broccoli
  • 3,048
  • 2
  • 21
  • 28
  • Thats what I thought at first too. But then why would the y velocity drop from 0 to -750 in less than 4 seconds, with an acceleration of only -5? Am I interpreting velocity.dy wrong? – Luigi Mangione Mar 03 '15 at 23:59
  • Pretty sure it's something like 100 pt/s^2. At least, that's how UIKit Dynamics works. – Zev Eisenberg Mar 06 '15 at 03:58