here is my protection against NaN. I am wondering since it gives me no problems (or yellow underline), but is totally different than Ben’s, if it is a potential minefield.
if (period != 0f)
{
float cycles = Time.time / period;
const float tau = Mathf.PI * 2;
float rawSineWave = Mathf.Sin(cycles * tau);
float movementFactor = rawSineWave / 2f + 0.5f;
Vector3 offset = movementVector * movementFactor;
transform.position = startingPos + offset;
}