Is this possible? In my 2D platformer; I want to make copies of myself whenever I walk? Is there something like this that duplicates the player every x seconds so it would look like the player has copies behind him when he walks that would follow him around?
Absolutely, just copy the character object, and offset it’s position, perhaps relative to the player’s velocity? Alliteratively, you could store the player’s past positions and use them to place the copies. You could then change the character’s material’s color value to simulate a fading effect.
So, yes it’s entirely possible with some simple code.
If you have pro, you could use motion blur, which judging by your example pic is what you’re after.
If you want more precise copies, specialy in a 2d game, why not simply clone your sprite with a time/space offset and a decreasing alpha? If your prefab has an alpha var and a delayToInput var, it shouldn’t be impossible to fake.
Very rough pseudo code, just to give the gist of things:
var delay : float; //set this to 0 on your main sprite
var alpha : float; //set this to 1 on your main sprite
var xOffset : float; //set this to 0 on your main sprite
thisSprite.alpha = alpha;
thisSprite.position.x += xOffset;
function RunRight()
{
yield WaitForSeconds(delay);
RunRightNow();
}
If you have 4 or 5 instances of your main sprite, whith quite a bit of experimenting and tweaking, this kind of approach could work. You’d have to do some lerping around, and just see what works for you! Did a much simpler but somewhat similar thing recently, faking reflections.