Review this generated patrol motor against the stated lifecycle contract.
While active, respond to PatrolClock.FixedTick and push only this Rigidbody; recover after re-enable, fail clearly on invalid setup, avoid per-tick logs, and keep Inspector configuration private.
csharp
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public sealed class PatrolMotor : MonoBehaviour
{
public float acceleration = 6f;
private Rigidbody body;
private void Start()
{
body = GetComponent<Rigidbody>();
PatrolClock.FixedTick += ApplyThrust;
}
private void OnDisable()
{
PatrolClock.FixedTick -= ApplyThrust;
}
private void ApplyThrust()
{
body.AddForce(transform.forward * acceleration);
Debug.Log("thrust");
}
}
generated code is illustrative, not from any one model