Amazing!! I can't believe I missed this video. Basically I got an asset which didn't have the time scaling and ended up getting another asset and combining them together. The whole thing was clunky even though it worked. This could have saved a 4 weeks+. Just replaced the b= a++; with b = (a = a + 1); then 1 is the variable that can Change. So happy to have found this tutorial now as it was continuously bringing new issues. Now I can remove the other asset
Pretty cool tutorial. Great job. I need some help tho. I need to make a "Replay" that is more like seeing another player doing the exact same movements that the player did before. But, it is not only the position but also the replay has to dash and shoot like the player.
Great tutorial! Thanks! I followed the guide and got it working with simple objects like the ball in the scene. I'd like to apply it also to the character, for example, downloaded from Mixamo and that have Animator component. Attaching the ActionReplay script to the parent doesn't work as expected. In Replay mode it changes position and rotation but of the whole object, the animations are not played. Could you advise?
I believe you could just add more variables to the ActionReplayRecord Class. For instance, you could add your current animation frame or something like that.
Hi, you would need to serialize the data to disk. The following documentation may help - docs.microsoft.com/en-us/dotnet/standard/serialization/basic-serialization 😊
Since your saving the data every frame and rely on replaying that at a slower speed for slow motion, unless you interpolate the data between frames, it I don't think you can smoothly do a slower timescale Maybe I'm missing something, but although this would be useful for most people, it's more of a bandaid fix to a easily solved issue
Hi, you're correct, the slow motion replay demonstrated here doesn't do any interpolation and would essentially be the equivalent of lowering the frame rate. This is a basic replay system that hopefully gives people an idea of where to start, but it can definitely be expanded and improved. You mention that this is an easily solved issue. I'd be interested to know what solution you have in mind when you say this. Thanks
@@KetraGames i think my reply got removed, but essentially what it said was deterministic replay systems are a lot more feasible due to not being as memory intensive and more accurate compared to a save state replay system with interpolation.
Yes, it will have an impact on performance. You would need to put a cap on the number of frames you store so that you don't run out of memory. The longer the replay and the more objects you have, the bigger the cost.
i have done a replay system recently, i had a list that had two informations which were the time in the timeline and data... I did this so i can watch the replay in the same speed and so i can slow motion it too... Then I found that the Update messes a few things and the FixedUpdate it´s not just fixed but it alsos fixes LOL
Is there an easy(ish) way to save these replays to files and maybe create a replay system similar to that of Rainbow Six Siege for example, with free cam, and a dedicated menu?
Hi, doing a full replay system with dedicated menu and custom cameras is possible but I probably wouldn't put it in the easy(ish) category 😊 This is definitely something we would like to come back to in the future and do more tutorials on, but in the meantime there is an asset on the asset store that looks promising - assetstore.unity.com/packages/tools/camera/ultimate-replay-2-0-178602. It isn't free but does offer a lot of the functionality you're after.
Can a replay editor be made with this method if possible how. can you make a tutorial about that. Iam asking for a replay editor like rockstar editor that is replay + free cam with insert keyframe , colour filters and so on
Hi, you could definitely expand on this to add more features. It is on our list for the future to revisit and do a more comprehensive action replay series, but probably not for a little while 😊
Hello, this was a great tutorial. I just need help with a problem I am having on my game. In my game I am using breakable assets, basically I have the normal asset and when it collides I activate the a bunch of fragments and deactivate the normal asset. I added the replay script to all the fragments and to the projectile that is breaking the objects. The problem I have is that when I activate the replay it is not synchronized with the projectile because the fragments where created after the projectile. Is there a way I can make the synchronize? Like add a delay to the fragments or to run the script while the fragments are unactive?
Hi, this is a really good question and I think you would need to refactor this a bit to get it to work with inactive objects. As a script won't run on an inactive object, you could try moving all the replay logic to a central script running on an active object. This could then call out to all the objects in your game, active or not, to get and set the current state for the replay. It's not that easy to explain in words, but hopefully this makes some sense 😊 At some point we plan to do a more detailed follow up on this video and we'll be sure to cover this problem.
@@KetraGames How I was able to do it was by making a very similar replay script but with some modifications and added the one to the fragments. On the start from the new script I would get how many frames had been recorded from the normal replay script on the projectile and then add that amount of frames with the starting position of the fragments. So now the replay is in sync.
Hi, you would need to set a maximum size for the list of data stored. Once you get over the maximum you could then remove the first entry. This will then limit the replay to a set number of frames. Hope that helps 😊
I tried doing this but my object freezes mid-air and goes through my plane even though it doesnt without the script :/ it has something to do with adding the records each fixed frame.
Hi, could you try copying the final script from www.ketra-games.com/2021/01/adding--an-action-replay-to-a-game-unity-game-tutorial.html to see if that helps? If not, can you send over some more details and we can try to work out what's going on
this is an absolutely amazing tutorial thank you but I have a huge problem I need the animations my player does to go along with the replay normally I try and solve stuff myself and very rarely ask but I have not the faintest clue on how to try and get that it would be infinitely helpful if you could reply and try and tell me how I could do that or if you could point me in the rt direction huge thanx in advance :)
Hi, glad you found this useful. Adding animations to this is a really interesting challenge. One way to do it would be to use the recording functionality of the animator. docs.unity3d.com/ScriptReference/Animator.StartRecording.html When switching to replay mode you would stop recording and start playback docs.unity3d.com/ScriptReference/Animator.StartPlayback.html You would then need to work out the playbackTime to pass in as your replay progresses. The downside of this approach is that once you stop recording I don't think there is a way to resume recording from that point, so it would be ideal for one off replays such as kill shots etc. but not for a continuous replay system. Another option is to add the relevant animation state to the replay data. You can get the current state from docs.unity3d.com/ScriptReference/Animator.GetCurrentAnimatorStateInfo.html You could then set the correct animation and animation time on the animator during the replay. Hope this helps get you started. Let us know how you get on 😊
@@KetraGames iv been trying for the past while but im so confused with it all and I cant find any videos on it or anything and iv read the documentation over and over again I just cant figure it out do you know of any tutorials or other stuff that might help or like an example script using it or something thnx in advance :)
@Idle Fang, sorry I've not been able to find any tutorials covering this either. Could you describe how you are planning to use the replay system in your game please? Maybe we could look at covering your scenario in a future video.
@@KetraGames I'm making a skateboarding game and I just want to have it so you can record and watch your tricks it was all working well except for the animation part cuz when you flip your board or do any tricks the character switches to an animation of the legs spread in the air but if I view the replay the player doesn't do any animations I feel like this should be super simple and common but I guess I was wrong thnx for all the help tho it definitely means alot of you have any questions I'm happy to aswer :)
Brilliantly executed. One of the best Unity videos ever.
You have won my loyalty.
Thanks so much for this comment 😊
Amazing!! I can't believe I missed this video. Basically I got an asset which didn't have the time scaling and ended up getting another asset and combining them together. The whole thing was clunky even though it worked. This could have saved a 4 weeks+. Just replaced the b= a++; with b = (a = a + 1); then 1 is the variable that can Change. So happy to have found this tutorial now as it was continuously bringing new issues. Now I can remove the other asset
Great, really glad it will be useful 😊
Pretty cool tutorial. Great job.
I need some help tho. I need to make a "Replay" that is more like seeing another player doing the exact same movements that the player did before. But, it is not only the position but also the replay has to dash and shoot like the player.
Wow, what a great tutorial! Thanks so much for walking us through this!!!
Thanks so much for this comment 😊
Basically a perfect tutorial. Thank you for this.
Thanks for this comment 😊
This was awesome! I also really appreciate the written instructions!!! New subscriber
Glad you found it useful. Thanks for the great feedback 😊
Great tutorial! Thanks! I followed the guide and got it working with simple objects like the ball in the scene. I'd like to apply it also to the character, for example, downloaded from Mixamo and that have Animator component. Attaching the ActionReplay script to the parent doesn't work as expected. In Replay mode it changes position and rotation but of the whole object, the animations are not played. Could you advise?
I believe you could just add more variables to the ActionReplayRecord Class. For instance, you could add your current animation frame or something like that.
Thank youu!! Other vids made it look so complicated but in the end its simple!
Great to hear, thanks 😊
also recording the velocity makes the replay look smoother
this is exactly what i was looking for in my game about time travel, this is such a great tutorial, good job!!
Great to hear, thanks 😊
I discovered your channel today and subscribed to it. Your videos are so instructives.
That's great. Thanks for your comment 👍
Thank you, thank you, thank you, thank you been looking for this tutorial for a long time!
Glad it was helpful 😊
Great Video, Thank you!
I was wondering if there was an easy way to save the replays so they won't be deleted when closing the game.
Hi, you would need to serialize the data to disk. The following documentation may help - docs.microsoft.com/en-us/dotnet/standard/serialization/basic-serialization 😊
Epic 🔥
Thanks for this 😊
@@KetraGames wanna contact you
Great Tutorial Thank You So Much!!!!!
Glad it was useful 😊
very cool :)
👍😊
Breathe air. God made all. His son, Jesus, pardoned all of all wrongs.
Since your saving the data every frame and rely on replaying that at a slower speed for slow motion, unless you interpolate the data between frames, it I don't think you can smoothly do a slower timescale
Maybe I'm missing something, but although this would be useful for most people, it's more of a bandaid fix to a easily solved issue
Hi, you're correct, the slow motion replay demonstrated here doesn't do any interpolation and would essentially be the equivalent of lowering the frame rate. This is a basic replay system that hopefully gives people an idea of where to start, but it can definitely be expanded and improved.
You mention that this is an easily solved issue. I'd be interested to know what solution you have in mind when you say this.
Thanks
@@KetraGames i think my reply got removed, but essentially what it said was deterministic replay systems are a lot more feasible due to not being as memory intensive and more accurate compared to a save state replay system with interpolation.
Thanks for the video.Won't this affect the game performance
Yes, it will have an impact on performance. You would need to put a cap on the number of frames you store so that you don't run out of memory. The longer the replay and the more objects you have, the bigger the cost.
how would you make it so that you can have multiple different recordings?
i have done a replay system recently, i had a list that had two informations which were the time in the timeline and data... I did this so i can watch the replay in the same speed and so i can slow motion it too... Then I found that the Update messes a few things and the FixedUpdate it´s not just fixed but it alsos fixes LOL
Is there an easy(ish) way to save these replays to files and maybe create a replay system similar to that of Rainbow Six Siege for example, with free cam, and a dedicated menu?
Hi, doing a full replay system with dedicated menu and custom cameras is possible but I probably wouldn't put it in the easy(ish) category 😊
This is definitely something we would like to come back to in the future and do more tutorials on, but in the meantime there is an asset on the asset store that looks promising - assetstore.unity.com/packages/tools/camera/ultimate-replay-2-0-178602. It isn't free but does offer a lot of the functionality you're after.
nice
Can a replay editor be made with this method if possible how. can you make a tutorial about that. Iam asking for a replay editor like rockstar editor that is replay + free cam with insert keyframe , colour filters and so on
Hi, you could definitely expand on this to add more features. It is on our list for the future to revisit and do a more comprehensive action replay series, but probably not for a little while 😊
Hello, this was a great tutorial. I just need help with a problem I am having on my game. In my game I am using breakable assets, basically I have the normal asset and when it collides I activate the a bunch of fragments and deactivate the normal asset. I added the replay script to all the fragments and to the projectile that is breaking the objects. The problem I have is that when I activate the replay it is not synchronized with the projectile because the fragments where created after the projectile. Is there a way I can make the synchronize? Like add a delay to the fragments or to run the script while the fragments are unactive?
Hi, this is a really good question and I think you would need to refactor this a bit to get it to work with inactive objects. As a script won't run on an inactive object, you could try moving all the replay logic to a central script running on an active object. This could then call out to all the objects in your game, active or not, to get and set the current state for the replay. It's not that easy to explain in words, but hopefully this makes some sense 😊
At some point we plan to do a more detailed follow up on this video and we'll be sure to cover this problem.
@@KetraGames How I was able to do it was by making a very similar replay script but with some modifications and added the one to the fragments. On the start from the new script I would get how many frames had been recorded from the normal replay script on the projectile and then add that amount of frames with the starting position of the fragments. So now the replay is in sync.
@@fabianarevalo2198 Great to hear 😊
How to rewind time to last 30 sec or something? script back me to start point. Please help
Hi, you would need to set a maximum size for the list of data stored. Once you get over the maximum you could then remove the first entry. This will then limit the replay to a set number of frames. Hope that helps 😊
I tried doing this but my object freezes mid-air and goes through my plane even though it doesnt without the script :/ it has something to do with adding the records each fixed frame.
Hi, could you try copying the final script from www.ketra-games.com/2021/01/adding--an-action-replay-to-a-game-unity-game-tutorial.html to see if that helps? If not, can you send over some more details and we can try to work out what's going on
this is an absolutely amazing tutorial thank you but I have a huge problem I need the animations my player does to go along with the replay normally I try and solve stuff myself and very rarely ask but I have not the faintest clue on how to try and get that it would be infinitely helpful if you could reply and try and tell me how I could do that or if you could point me in the rt direction huge thanx in advance :)
Hi, glad you found this useful. Adding animations to this is a really interesting challenge. One way to do it would be to use the recording functionality of the animator.
docs.unity3d.com/ScriptReference/Animator.StartRecording.html
When switching to replay mode you would stop recording and start playback
docs.unity3d.com/ScriptReference/Animator.StartPlayback.html
You would then need to work out the playbackTime to pass in as your replay progresses.
The downside of this approach is that once you stop recording I don't think there is a way to resume recording from that point, so it would be ideal for one off replays such as kill shots etc. but not for a continuous replay system.
Another option is to add the relevant animation state to the replay data. You can get the current state from
docs.unity3d.com/ScriptReference/Animator.GetCurrentAnimatorStateInfo.html
You could then set the correct animation and animation time on the animator during the replay.
Hope this helps get you started. Let us know how you get on 😊
@@KetraGames wow thanks so much il definitely look into all that when I have time!
@@KetraGames iv been trying for the past while but im so confused with it all and I cant find any videos on it or anything and iv read the documentation over and over again I just cant figure it out do you know of any tutorials or other stuff that might help or like an example script using it or something thnx in advance :)
@Idle Fang, sorry I've not been able to find any tutorials covering this either.
Could you describe how you are planning to use the replay system in your game please? Maybe we could look at covering your scenario in a future video.
@@KetraGames I'm making a skateboarding game and I just want to have it so you can record and watch your tricks it was all working well except for the animation part cuz when you flip your board or do any tricks the character switches to an animation of the legs spread in the air but if I view the replay the player doesn't do any animations I feel like this should be super simple and common but I guess I was wrong thnx for all the help tho it definitely means alot of you have any questions I'm happy to aswer :)
It’s not working for me