Recording video during Play.

Hello all,:slight_smile:
I developing a ‘Pick-Up Stick’ game. I would want to record a short video from the main camera,When the player starting an action, So he could see he did something wrong…
I searched this problem on the internet but i couldnt find any suggestions to the problem.

Could it be done?
Please help me :S

Hi, you would probably be better off just recording the locations/rotations/etc. of your game objects that are involved and then just use that data to do a replay rather than trying to record an actual video… kinda like how the demos work in Half Life/CS/etc or Halo or probably any other game.

Found that not sure thats what your looking for but may work.

Hi,
The link you gave me is quite great! but i got 2 problems…
How do I reload those picture at the same order?
How do I save them in the place where the game export?
I mean when I build and export him to someone else, where can i be sure the save will be saved?

anyway thank you for this link :smile: :smile: :smile:

you can make a waypoint like system, and store all the critical events and the time they occur, then use the same scene with the ‘waypoints’ and the events you store in some structure or class or whatever fits your needs.

should be same thing, but beware of the physics engine >:) mwhahaha

I thought about a solution what will fix for both and i got the Queue.
By using system.Collections.Generic I can use Queue,There the pictures will be saved and I could see the pictures in the same order :smile:
But like always i got a problem…
which type is CaptureScreenShot? and how can i change them to texture2d or anything I can show?
thank you for your help :smile:

Application.CaptureScreenshot does all the saving for you but doesn’t return anything so you’ll have to load it back into the game yourself.

How can I load it by script?
where could I find the the screen shots before the game exported? where it will be when the game exported?

The string you pass in is the path to the file that is saved. You can load it back in using WWW.

thank you for reply…
WWW downloads the picture from the path I gives it, but the problem it is slow, very slow for 200 in a sec, so it take too many time to do it.
this is the code i gave to load the pictures

public void LoadImages(){
		Queue<Texture2D> tempvidoe=new Queue<Texture2D>();
		working=true;
		//loading the picture from the path
		while(CurrectlyIncrement<imageIncrement){	
			if(temp.isDone){
			temp=new WWW(Application.dataPath+myString + "_" + CurrectlyIncrement + ".png"); 
			kindaVidoe.Enqueue(temp.texture);
			lastFrameTime = Time.time;
			CurrectlyIncrement++;
			}
		}
               //show them on gui
		while(kindaVidoe.Count>0){
			temp2=kindaVidoe.Peek();
			tempvidoe.Enqueue(kindaVidoe.Dequeue());
		}
               //returning them to the main queue for replays
		working=false;
		while(tempvidoe.Count>0)
		kindaVidoe.Enqueue(tempvidoe.Dequeue());
			
		}

If you’re trying to implement a “replay” feature that is probably the worst way to go about it for the exact reason you just pointed out. That and long games would literally eat someone’s hard drive.

so what are you suggest? to record the locations and the roatation and all this for just a reply?
Is there a code which save all teh gameobject locations and ratations?
and How do i will load it? just to put for each gameobject the location he is doing?

thanks by the way for your help… I wouldnt know what to do else

ShadoX’s suggestion is probably the best route to go. How you save, load, and run them is largely up to you.