### Ship Controls Component in C#
Source: https://sbox.game
This component moves the object forward in the camera's direction when the 'forward' input is pressed. It utilizes a configurable speed and the delta time for smooth movement.
```csharp
///
/// Moves the object forward in the camera direction when pressing forward
///
public class ShipControls : Component
{
///
/// The speed to move the object
///
[Property, Range( 0, 1000 )]
public float Speed { get; set; } = 200.0f;
protected override void OnUpdate()
{
if ( Input.Down( "forward" ) )
{
var forward = Scene.Camera.WorldRotation.Forward;
WorldPosition += forward * Speed * Time.Delta;
}
}
}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.