Oscillate at offset position...?

Can someone show me how to oscillate an object at a particular position.

This code will do the oscillation

float offset = Mathf.Sin(Time.time * WaveLength) * Amplitude;

Vector3 Cur_Pos=transform.position;
Cur_Pos.x=offset;
transform.position=Cur_Pos;

But this will make the x value oscilate through 0.like (-x to 0 to +x)
I need to oscillate the object at a particular position say(-x to 40 to +x) where the resting X position of the object is 40.

Thanks… :slight_smile:

Something like this?

Vector3 targetPosition = new Vector3(40, 1, 2);
Vector3 oscillationDirection = new Vector3(1,0,0);

float offset = Mathf.Sin(Time.time * WaveLength) * Amplitude;

Vector3 osc = offset*oscillationDirection;

transform.position = targetPosition + osc;