PhysicsBodyComponent.Teleport(Vector2, Nullable) Method
Definition¶
Namespace: Brine2D.ECS.Components
Instantly moves this body to position (and optionally sets its rotation) without triggering a full body rebuild. Linear and angular velocity are preserved. For kinematic bodies the previous-position and previous-rotation records are also reset, preventing a phantom velocity spike on the next fixed update.
public void Teleport(System.Numerics.Vector2 position, System.Nullable<float> rotation=null);
Parameters¶
position System.Numerics.Vector2
rotation System.Nullable<System.Single>
Remarks¶
The TransformComponent is always updated, even before the physics system has created the body, so the body spawns at the correct position on first tick.