follow player

I have a FPS. So whenever i touch an object(sphere) it should follow the player(FPS).

It is like a snake game.

So what should be the scripting for this?

Well, here is a starting point, add the object(sphere) as a child object of the player(fps). You do this by setting the .parent of the object(sphere) to the player(FPS) object.