this is a 2D Receiving game,I holp if main player eat an object that next the main player create another player and follow the main player(it will not be conterl).
Nice animation =) Giving you an up just for that... So, do you want it like that old snake game, you "eat" a bubble, the bubble goes on your back, etc. etc.?
To spawn an object, use instantiate... http://unity3d.com/support/documentation/ScriptReference/Object.Instantiate.html
To have them follow/rotate to you, you can use
var target : Transform;
var rotateSpeed = 0.0;
var speed = 0.0;
function Update () {
var targetRotation = Quaternion.LookRotation(target.position - transform.position, Vector3.up);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * rotateSpeed);
transform.Translate(0, 0, speed);
}
This'll move and rotate the object towards you... Change the rotation speed and speed up top... Or in the editor....
Hope this is what you're asking for!
A relatively cheap solution would be to have the 2nd object echo the movements (positions, or forces if you are using them) of the player, on a time delay.
If the objects are solid you may run into difficulties though if the player backtracks, running into the object that is following. Might be solveable by repeating the original trigger logic- if the main player is next to it, it stops moving, then starts following again as the player moves away.
Another approach might be to try and adapt the 3rd-person camera script, which comes with Unity and keeps a camera behind and above the player. Should be able to adapt it for 2d, and a non-camera object.