```csharp
using UnityEngine;
public class ForwardMovement : MonoBehaviour
{
public float speed = 5f; // Movement speed
void Update()
{
// Check if the up arrow key is pressed
if (Input.GetKey(KeyCode.UpArrow))
{
// Move the object forward
transform.Translate(Vector3.forward * speed * Time.deltaTime);
}
}
}
```
To use this script:
1. Create a new C# script in your Unity project and name it "ForwardMovement"
2. Copy and paste the above code into the script
3. Attach the script to the GameObject you want to move
4. Adjust the `speed` variable in the Inspector if needed
5. Press Play and use the up arrow key to move the object forward
This script will continuously move the object forward as long as the up arrow key is held down. The movement speed can be adjusted in the Inspector or by changing the `speed` variable in the script.