Tag Archive for: Oscillate Position on X-Axis Expression

Oscillate Position on X-Axis Expression

//OSCILLATE POSITION BACK AND FOURTH ON X AXIS: amplitude = 10; frequency = 3; temp=amplitude*Math.sin(time*frequency)+amplitude; // add the result to the current x pos temp=temp+transform.position[0]; //plug the new x into slot 0. y is currently left unchanged [temp, transform.position[1]]