Wednesday Discount - Lifetime Access for $20!!!! - Click Here!

Physics Events – Story Tellers iOS Starter Kit Documentation

  • ReverseGravity – will reverse whatever the gravity currently is in the scene. No value is needed. If the gravity was {2, 4} it will be {-2, -4}

physics event 1

  • ReverseGravityOnX – will reverse whatever the gravity currently is, but only on the x axis
  • ReverseGravityOnY – will reverse whatever the gravity currently is, but only on the y axis
  • GravityOn – the value will be the Element to enable gravity. The Element should already have a physics body set.

physics event 2

  • GravityOff –   the value will be the Element to no longer be affected by gravity. The Element should already have a physics body set.
  • GravityOnOrOff –   the value will be the Element to toggle the effect of gravity on them
  • DynamicOn – the value will be the Element to toggle the physics dynamic property on. Once on, it will be included in the scene’s physics simulations. The Element should already have a physics body set.
  • DynamicOff – the value will be the Element to toggle the physics dynamic property off. The Element will be excluded from physics simulations but still retain it’s collision body. The Element should already have a physics body set.
  • DynamicOnOrOff – will toggle the dynamic property on or off.
  • RotationOn – will allow the physics body to rotate.

physics event 3

  • RotationOff – will disable the physics body from rotating.
  • RotationOnOrOff  – will toggle whether or not the physics body is allowed to rotate.
  • SetGravity – sets the world’s gravity in  {x, y} format. In the example below, gravity is -2 on the y axis and gravity is 0 on the x axis (so no pull on x)

physics event 4

  • ForceVector – when used as a TouchEvent set a String value for the force to apply to the Element touched. The vector is defined in  {x, y} format.  This can also be a Dictionary where each key name is the Element and the key value is the vector (see the image below).

physics event 5

  • ImpulseVector – when used as a TouchEvent set a String value, for the vector impulse to apply to the Element touched. The vector is defined in  {x, y} format.  This can also be a Dictionary where each key name is the Element and the key value is the vector (see the image above).
  • StopPhysics – You might notice when trying to stop a physics body from moving (for example, by disabling gravity or rotation) it still has “something” pushing it around. This is probably due to leftover forces and angular velocities still being applied. If that’s the case, use this property.

physics event 6


Detecting Collisions with Specific Objects

To read more about this visit the general properties page for Elements. 

 

 

 

 

 

 




Know what an affiliate program is? You make money just by sharing links to our site! Win. Win.

Earn when you refer any buyer here! 30 day tracking. Commissions are 33%-50% and recur on subscription products!