Easier code

if(movementFactor > 0) {
transform.position = startingPosition + movementVector * Mathf.Sin(Time.time * movementFactor * speed);
}

(Added a serialized speed var)

Privacy & Terms