# 13 – Motion and Physics

(Note: page update in progress)

Attributes used by physics

Scene Gravity: The force of gravity to apply to actors in the scene, in pixels per second per second. Since Earth’s gravity is 9.6 meters per second per second, and GameSalad uses 50 pixels per meter, you can make your scene have Earth’s gravity with a value of x = 0, y = 480.

Actor Motion Values

Center of Mass: The point on the actor (in pixels) that most physics forces are applied to. x = 0, y = 0 is the center of the actor.

Linear Velocity: The initial velocity of the actor, in pixels/second.

Angular Velocity: The initial rotational velocity of the actor, in degrees/second. The rotational force is centered at the actor’s Center of Mass.

Max Speed

Apply Max Speed

Actor Physics Values

Density

Friction: How much an object is slowed when sliding against another object. Value between 0 (very slippery) and 50 or more (very sticky). When two objects slide against each other, the friction value used is sqrt(<friction of object 1> times <friction of object 2>). This value is also known as the coefficient of friction. Note: to use the CoF for a material found in physics books in GameSalad, multiply the value by 50.

Bounciness: Determines if an object bounces when it collides with another object, and how much of its original speed it has after the collision. Value between 0 (no bounce on collide) to 1 (full bounce with no slowdown on collide). When two objects collide, the higher bounciness value of the objects is used. This value is also known as restitution. Note: if an object’s relative speed to something it collides with is 50 or less, bounciness will be ignored.

Fixed Rotation

Movable: Flag that marks the actor as dynamic (can be affected by physics forces), or static (cannot be affected by physics forces). Note that even though an actor is flagged as not movable, its physics attributes can affect other actors.

Drag

Angular Drag

Collision Shape: Defines the boundary around the actor that will be used for collision detection. Does not necessarily correspond to the visible shape of the actor.

Behaviors that affect physics

Accelerate: Applies a force to an actor that causes it to accelerate at a given angle. The acceleration units are pixels/second/second, and the angle is in degrees.

Accelerate Towards: Same as Accelerate, but the direction of the acceleration is toward a given point, instead of a given angle.

Rotate: Changes the angular velocity of an actor. This is the equivalent of setting the Motion->Angular Velocity attribute of an actor.