I have randomly spawning Obj. and i have to animate it by script

it should move by “x” axis , between -2 f and 2 f, animation have to be ping-pong type. Please help!

Use the DotWeen Library… free and exactly what you need !