Motion2D#
Optional arcade motion for a root entity with a uniformly scaled circle collider. Scene phases own stepping; scripts express velocity/teleports and receive contacts. No forces, mass, gravity, joints, or dynamic-body impulse solving are implied.
public sealed class Motion2D : ScriptUsage and examples
Members: CollisionLimitHits · Position · Radius · Response · Restitution · Stop · Teleport · Velocity
CollisionLimitHits#
public int CollisionLimitHits { get; }Position#
public Vector2 Position { get; }The body's world position. A body may sit under a parent (a layer, a moving platform): it moves in world units and its circle is the world size of its collider.
Radius#
public float Radius { get; }Response#
[System.ComponentModel.DefaultValue(MotionResponse2D.Bounce)]
public MotionResponse2D Response { get; set; }Initial value: MotionResponse2D.Bounce
Restitution#
[System.ComponentModel.DefaultValue(1f)]
public float Restitution { get; set; }Initial value: 1
Stop#
public void Stop();Teleport#
public void Teleport(Vector2 position);Moves the body to a world position at once, forgetting the sensors it was inside.
Velocity#
public Vector2 Velocity { get; set; }Related types#
Source#
- Motion2D.cs