on the fly video/screenshots will take alot of ressources. i am not sure if it’s possible. i guess it’s better to somehow store all the movement information of your car and move the car according to this data in your game itself for a replay.
Actually i am using this script for making screenshots
var count : int = 0 ;
var record : boolean = false;
function Update () {
if(record){
Application.CaptureScreenshot(Application.dataPath + “/Resources/abc” + count++ + “.png”);
}
}
function OnGUI()
{
if(GUI.Button(Rect(80,30,60,50),“Record”))
{
record=true;
}
if(GUI.Button(Rect(150,30,60,50),“Stop”))
{
record=false;
}
}
and for movement i am using
var count : int = 0;
var replay = false;
var timer : float =0.0;
function Update () {
timer +=Time.deltaTime;
if(replay timer >.1)
{
GameObject.Find(“VideoMode”).guiTexture.texture=Resources.Load(“abc” + count++);
timer=0;
}
}
function OnGUI()
{
if(GUI.Button(Rect(220,30,60,50),“Replay”))
{
replay=true;
}
}
actually i don’t want to implement it by this so that i save resources… give me another idea for its implementation
i still think that it does not make any sense to make a screenshot every update. video / many pictures will always take huge parts of memory away. if you want a direct recording there are external tools like fraps that can help users for example.
It’s usually done by recording user input and doing everything possible to ensure the game is strictly deterministic (meaning that if you play the game identically two times, the game will play identically too.) That’s going to be tricky because PhysX isn’t guaranteed to be deterministic, so you’re going to have to be very conscious of that, or not use any of the physics stuff. I had an idea for a game where replays were absolutely vital to gameplay, but haven’t had the time to put together a prototype. So I can’t say for sure whether you’re going to run into any major problems in Unity’s tech which might stop you in your tracks. It’s a better bet than taking screenshots every frame and/or trying to encode a video as you play though.