I’m working on an orbital system, where the rotation speed is higher, the closer the object is to the center of its system. Does anyone know an effective method for executing this? Thank you in advance.

You could try something like this:

```
public float EvaluateSpeed(float distance)
{
const float TOP_SPEED = 1000.0f;
const float MAX_DISTANCE_FOR_EFFECT = 100.0f;
return AnimationCurve.Linear(0.0f, TOP_SPEED,MAX_DISTANCE_FOR_EFFECT, 0.0f).Evaluate(distance);
}
```

Obviously, you can replace AnimationCurve.Linear with a custom AnimationCurve if you like if this function is part of a mono behaviour:

```
public class SpeedEvaluater: MonoBehaviour
{
public AnimationCurve m_speedCurve;
public float EvaluateSpeed(float distance)
{
return m_speedCurve.Evaluate(distance);
}
}
```

In these examples, the distance you pass in is the X axis of the curve, which returns the corressponding y axis value. (Speed)