Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

[Depreciated] Ultimate Replay - Complete state based replay system

Discussion in 'Assets and Asset Store' started by scottyboy805, Jun 28, 2017.

  1. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Yes you can send us your scene to info(at)trivialinteractive.co.uk but you would need to provide some instructions on how to use the scene and what you are trying to do.

    Yes the steps you mention are possible but there is nothing built in automatically to move onto a new recording. You will need to write a little script that waits for the playback to end and then changes to the next replay.

    If you want to detect when playback has ended it would be best to create a script that inherits form 'ReplayBehaviour' and override the 'OnReplayEnd' method because this will be called directly when the last frame of the recording has finished. I would have to check but I am fairly sure that the condition you use would never be true because the ReplayManager time value can never go beyond the end of the recording duration.
     
    UA_AV likes this.
  2. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Ultimate Replay 2.0 is now in development. To track development progress or suggest features/changes use the WIP thread which can be found here.
     
  3. UA_AV

    UA_AV

    Joined:
    Apr 18, 2017
    Posts:
    14
    Hi there, and it has been a while since I made a reply.

    I have found the cause of the bug I opened up to you and it is due to how I call my functions. As a result, I had to limit the number of functions I call during the recording.

    Thank you!
     
  4. UA_AV

    UA_AV

    Joined:
    Apr 18, 2017
    Posts:
    14
    Hello, and I have found an issue with regards to beginning a playback at a specified time.

    Based on your code documentation, I must call the SetPlaybackFrame(float, PlaybackOrigin) method before I call the BeginPlayback(false) method.

    With that, here is my custom function.
    Code (CSharp):
    1. public void BeginPlaybackNotFromStart(float _time)
    2. {
    3.     ReplayFileTarget replayFileTarget = FindObjectOfType<ReplayFileTarget>();
    4.     if (replayFileTarget != null)
    5.     {
    6.         replayFileTarget.FileOutputDirectory = $"{ Application.streamingAssetsPath }/{ replayFileDirectory }";
    7.         replayFileTarget.FileOutputName = replayFilename;
    8.  
    9.         ReplayManager.SetPlaybackFrame(_time);
    10.         ReplayManager.BeginPlayback(false);
    11.     }
    12. }
    However, after calling my BeginPlaybackNotFromStart(64.0f) function, the playback starts from the top (or at 0:00).

    For now, my temporary workaround for my BeginPlaybackNotFromStart(64.0f) function goes this way:
    Code (CSharp):
    1. public void BeginPlaybackNotFromStart(float _time)
    2. {
    3.     ReplayFileTarget replayFileTarget = FindObjectOfType<ReplayFileTarget>();
    4.     if (replayFileTarget != null)
    5.     {
    6.         replayFileTarget.FileOutputDirectory = $"{ Application.streamingAssetsPath }/{ replayFileDirectory }";
    7.         replayFileTarget.FileOutputName = replayFilename;
    8.  
    9.         ReplayManager.BeginPlayback(false);
    10.         ReplayManager.SetPlaybackFrame(_time);
    11.     }
    12. }
    The playback starts from the top for a number of frames before "skipping" to my specified time, which is at 64 seconds or at 1:04.

    I am using ReplayFileTarget as the ReplayManager's Target.

    May I know how I can get through this issue?

    Thank you very much in advance.
     
    Last edited: Feb 5, 2020
  5. haraldk

    haraldk

    Joined:
    Apr 25, 2013
    Posts:
    3
    Hi,

    I noticed today that a simple

    Code (CSharp):
    1. SceneManager.LoadScene("Empty", LoadSceneMode.Additive);
    will completely break the playbacks. I tested this in the CubeDemo and Unity 2019.3 too just to make sure.
    Is there some setting or setup I might be missing?
     
  6. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi,
    Sorry for not responding. I did not get any notification that you had posted.

    As you have discovered, Changing scenes for playback is not supported at the moment because each recording stores scene specific information to make it possible to replay the objects. A possible solution is to additivley load the record scene into another scene for playback but you would need to make sure that the recording source scene is active. We are currently woking on Ultimate Replay 2.0 which will remove this limitation entirely.
     
  7. DJ_Design

    DJ_Design

    Joined:
    Mar 14, 2013
    Posts:
    126
    Hey- Love the concept of this but I'm struggling to cache the replay to another player over a photon network.
    Would you be able to direct message me with some tips once you are free to do so?

    Thanks for your time!
     
  8. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi, Are you trying to send a full replay to another client or are you just trying to record networked objects? Are you using a replay memory target for storing the replay or a file target? A file target would be recommended for this sort of thing and then setup a tcp connection to send the file to the other client. If you are trying to sync replays per frame accross the network then we would not recommend this. Instead we would suggest that each client records their own replay and networked objects can be synchronized over the netowork as normal and then recorded like any other object.
     
    DJ_Design likes this.
  9. DJ_Design

    DJ_Design

    Joined:
    Mar 14, 2013
    Posts:
    126
    Hey thanks for the reply!
    I'm trying to send the recorded data to a player over the network, for temporary replay use.
    I realize a full replay might be too much, so I would imagine it would work where the client records, and when an event is called I send only a snippet of the replay (last 5 seconds or so) as to save data.. what do you think?
    I thought using a file transfer would be best but maybe not.
    Either way very open to any insight into which would be easier on the network.
     
  10. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    If you only want to send small snippets of the replay then a replay file will not be suitable due to the way it stores the data. You would have to send the whole file otherwise the data would be unreadable.
    You could use a memory target to record the data but then you would likley need to modify the source code to extract the data required and send it over the network. Essentially a memory target stores the following data:
    • A collection of ReplaySnapshots - Contains the state information for all replay objects at a given time represented by a time stamp value
    • An initial data buffer - Used to recreate prefab instances that were spawned or despawned during recording
    • The name of the scene where the recording was captured.
    You would need to serialize all of these and send them over the network after your predetermined amount of time. It is not too difficult because the ReplaySnapshot and ReplayInitialDataBuffer types both have serialize and deserialize methods that accept a binary writer/reader. You will need to modify the source code to allow access to these private types declared in the ReplayMemoryTarget class.

    If you take a look at the related source code you should get an idea of how things are stored and how they work. If you need any help with specifics then let me know and I will be happy to help.
     
    DJ_Design likes this.
  11. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    Hello, I am trying to make Ultimate Replay to work with my sports sim replay module. I have number of field players running around the field. They have rigged animated bipeds, and their animation changes according to parameter of speed. If speed is 0 then they are in idle animation, if it is 3 they walking and if it 8 they are running. I am attaching Replay Animator script to field player object, point it's animator to script, attaching Replay Object and Replay transform.
    When I play the game I can see, that field players are animated according to animator blend tree. But once I make a recording and try a replay I see, that speed parameter is not being recorder by Replay Animator , so each field player is stuck with single value for speed and they are stuck in single animation. Is it possible to store speed parameter with Replay Animator script? Or is there any way to store changes in speed and apply it on replay?
     
  12. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi,
    Animator parameters are not recorded at the moment so you would need to record them manually. You could do this by creating a class that inherits from 'ReplayAnimator' and override the 'OnReplaySerialize' and 'OnReplayDeserialize' methods (Making sure to call the base method). You can then serialize and deserialize animator parameters as required.

    Alternativley you could opt to not use the ReplayAnimator component and instead attach a ReplayTransform component to each joint in the hierarchy. This will allow you to record and replay bone animation and will likley be more accurate too.
     
  13. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    I tried this approach, but unfortunately performance dips when I put it on 11 players.
    I will try to do as you suggested and extend Replay Animator with custom parameter.
     
  14. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Are you using one ReplayObject component for the whole character hierarchy when trying this? We are not aware of any performance issues but we will look into it and see if we can do anything to improve it. Let me know if you need any help with recording extra parameters.
     
  15. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    I instantiate players from prefab and attach single ReplayObject to parent object and ReplayTransforms to every child objects (bones and joints).


    Can you elaborate on this? I am trying to do like this, but I am not sure that I do it correctly


    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class ExtendReplayAnimator : UltimateReplay.ReplayAnimator
    {
    // Start is called before the first frame update
    void Start()
    {
    }
    // Update is called once per frame
    void Update()
    {
    }
    public override void OnReplaySerialize(UltimateReplay.ReplayState state)
    {
    Debug.Log("Overriding animator serialization");
    base.OnReplaySerialize(state);
    int layerCount = (recordAllLayers == true) ? observedAnimator.layerCount : 1;
    for (int j = 0; j < layerCount; j++)
    {
    float speedParam = observedAnimator.GetFloat("Speed");
    state.Write(speedParam);
    }
    }
    public override void OnReplayDeserialize(UltimateReplay.ReplayState state)
    {
    Debug.Log("Overriding animator deserialization");
    base.OnReplayDeserialize(state);
    }
    }
     
  16. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Yes that looks OK to me so far. You just need to match the written values in the deserialize method by reading the float data and then you can apply the speed value to the animation using 'SetFloat'. Make sure that you add your deserialize code after calling the base deserialize method to avoid corruption.
     
  17. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    Ok, I think I got this. Now speed is recording with the transform. So, it looks like animator state is a series of data in strict order. First you write this sequence, and then you read it back an apply to animator. All I needed is to add to the end of this sequence my parameter of speed, and then read it also from the end.
    Working code looks like this.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class ExtendReplayAnimator : UltimateReplay.ReplayAnimator
    6. {
    7.     // Start is called before the first frame update
    8.     void Start()
    9.     {
    10.  
    11.     }
    12.  
    13.     // Update is called once per frame
    14.     void Update()
    15.     {
    16.  
    17.     }
    18.  
    19.     public override void OnReplaySerialize(UltimateReplay.ReplayState state)
    20.     {
    21.         Debug.Log("Overriding animator serialization");
    22.         base.OnReplaySerialize(state);
    23.         float speedParam = observedAnimator.GetFloat("Speed");
    24.         state.Write(speedParam);
    25.        
    26.     }
    27.     public override void OnReplayDeserialize(UltimateReplay.ReplayState state)
    28.     {
    29.         Debug.Log("Overriding animator deserialization");
    30.         base.OnReplayDeserialize(state);
    31.         observedAnimator.SetFloat("Speed", state.ReadFloat());
    32.     }
    33.  
    34. }
     
    scottyboy805 likes this.
  18. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Yep you got it. The same applies if you want to record any other custom component data that is not supported by default.
     
  19. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    Have another question regarding bones tracking for biped. I have player character on scene, this is a biped with bones controller by VRIK plugin. I wrote script that assigns Replay Transform on all children of biped and I put one ReplayObject on parent object. I observer strange behaviour with this arrangement. Sometimes all bones tracks and replays fine, but sometimes not. Can VRIK interfere with UltimateReplay?
     
  20. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi,
    I am not familiar with VRIK plugin but here are a couple of things to check:
    1. Make sure that all ReplayTransform components in the hierarchy are set to record local position and rotation if they are not already.
    2. Make sure that any scripts or components from the VRIK plugin are not intefering with the playback of the object during a replay. Usually all non-ReplayBehaviour scripts will be disabled by Ultimate Replay prior to starting playback but maybe they are not in this case. Also check that scripts not attached to the object directly are not intefering such as manager scripts etc.
    Let me know if you are still having issues after trying these things.
     
  21. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    All ReplayTransform are showing local position and rotation.

    I can see that during replay all components are disabled except needed by UltimateReplay.
    Strange thing is that sometimes it all works as it should, replay of the biped animations is playing correctly, but sometimes not, the biped just freezes during replay.
     
  22. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Is there an animator component running during playback or any physics components that could be interfering? Apart from that I cannot think what else could be happening. If you are able to send the project to info(at)trivialinteractive.co.uk we would be happy to look into it further.
     
  23. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    The animator component is there, but it is disabled during the playback. Also, I narrowed down the bug to the fact that recording only works when I run the script that attaches ReplayTransforms and ReplayObject only first time. On second run playback don't work, but if I remove script, run the game, and then add the script again it works fine again. Like if something prevents recording of the biped on second run.
     
  24. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    That is strange. When you are adding the replay components via script, are you adding the ReplayObject component first? If not then Ultimate Replay will try to create a ReplayObject component at the same hierarchy level when adding the transform component. If the ReplayObject is created first then all child components should detect this automatically.
     
  25. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    I add components like this

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class PlayerReplayHelper : MonoBehaviour
    6. {
    7.     private GameObject biped;
    8.  
    9.     // Start is called before the first frame update
    10.     void Start()
    11.     {
    12.         biped = this.transform.gameObject;
    13.         PrepareForReplay();
    14.     }
    15.  
    16.     // Update is called once per frame
    17.     void Update()
    18.     {
    19.        
    20.     }
    21.  
    22.     public void PrepareForReplay()
    23.     {
    24.         biped.AddComponent<UltimateReplay.ReplayObject>();
    25.  
    26.         Component[] bipedChildComponents = biped.GetComponentsInChildren<Transform>();
    27.         foreach (Transform bipedChild in bipedChildComponents)
    28.         {
    29.             bipedChild.gameObject.AddComponent<UltimateReplay.ReplayTransform>();
    30.         }
    31.  
    32.     }
    33. }
    34.  
     
  26. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Yes that looks fine to me. I don’t know what else to suggest in that case. As I said, if you are able to send us the project we could take a look as I think we have covered most of the trivial possible causes.
     
  27. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    188
    Hello there creator of UltimateReplay! :)

    This is my first time posting here and thought leaving my story here.

    Due to the interest of playing Call of Duty lately and Black Ops 4 in particular I felt hyped to begin my experiment regarding the replay part. At the end of each round in that game, there will be shown a "Best Play" which basically is the best play of the game in terms of kills in a row. However, when you compare to other (older) games they sometimes featured the Final Kill. This is what got me started.

    After the first day trying out this asset I played around for a bit and tried to integrate it into an old project of mine. Not the best results in terms of complexity that the game had ( different weapons, round timer etc. ). o_O

    But now comes the cooler part though.:p On the second day I started reading the documentation and then learnt my issues and pointers I had to fix. With a simple fresh new project I started building this stuff and here's what I had in the end: :D Nothing fancy but OK nonetheless.


    Now that I know how this thing works I think I can continue on using it further and who knows where it'll take me.
    I'll leave a nice review on it soon. Cheers!
     
    scottyboy805 likes this.
  28. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi.
    Thanks for sharing. Looks like a fun little experiment project that you put together. Glad to hear that Ultimate Replay is helping you to achieve your project goal and would be interested to see progress as you go as we are always interested in how our assets are being used. If you need help getting things to work or have any questions then we will be happy to help. Best of luck with the project and reviews are highly appeaciated so thank you.
     
  29. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    188
    Thank you too for building this asset!
     
  30. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    188


    Oh.

    Edit: That's kind of sad news for a small project I'm working on. No profit, just a WebGL game. :( I was thinking to add this as a cool feature at the end of the game (where the player has to kill a few enemies in 30 seconds and you guessed it that will be the replay at the ending :oops:)

    Might have to look for an alternative but this asset was nice to try out nonetheless.
     
  31. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Yes, Unfortunately the trial version is intended for evaluation purposes only and we must prevent building and not provide source code or there is no incentive to purchase the full version. It took alot of development effort and is how we butter our bread so i hope you understand.
     
  32. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    188
    I can understand that. Building a system like this isn't easy at all.
     
  33. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Ultimate Replay 1.2.0 has been submitted to the asset store for review. This version fixes a bug where the playback sequencer would invert the playback time scale if it was negative causing reverse playback to not work as expected.
     
  34. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    Hello, I am returning once again to replay feature in my project and I still can't get it to work properly. Can you please take a look at attached package? I still having this intermittent bug, when sometimes replay work on a first run and then it stops working on second.
    I am instantiating prefab with animated character, adding ReplayTransform to bones and ReplayObject to root. Character is in constant animation loop. On the first run everything works normal, I can start recording and replay it, on the second run the character freezes.
     

    Attached Files:

  35. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi,
    Thanks for taking the time to create this repro example. Unfortuntely, we are not able to view the model or animations in game because they are .max files and we do not have 3ds software or licenses. The mesh is missing in editor and in game and also Unity reports that there are no animations due to that fact that the model was not importable without 3ds Max. Would it be possible to convert the models to .fbx format and then we will be happy to take another look.
     
  36. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    Hello, ok, I converted max to fbx and replace prefabs. Please take a look at this package.
     

    Attached Files:

  37. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi, Thanks for converting those assets to fbx.
    We have had a look at the project you sent and it looks like you are adding replay components after instantiating the prefab. This is OK but we would highly recommend that you add all the necessary replay components at edit time (via an editor script if it's easier) otherwise you may see issues. It appears that no data is being stored for the components that you have added because the ReplayObject doesnt know about them. After adding replay components at runtime, you should call 'ReplayObject.RebuildComponentList' for those new components to be recordable. Secondly, when Ultimate Replay comes to re-instantiate this prefab during playback, these dynamically added components will not exist since Ultimate Replay does not recreate recorded components. The only way to do this would be to override the instantiate call by adding an event method to the 'ReplayManager.OnReplayInstantiate' hook and you can then re-add the components manually. Note that in order for playback to work correctly, You will also need to ensure that the ReplayIdentity for each component is identical. This is the tricky part and is why we recommend sticking to edit time recorder components because all of this is handled for you. Note that if you see warnings like 'Possible replay state corruption for replay object', it generally means that a replay component could not be found via its replay identity (Ie it has either been destroyed or changed identities between recording and playback) and that playback will be inaccurate.
     
  38. AndreyDobrikovMSG

    AndreyDobrikovMSG

    Joined:
    Aug 28, 2019
    Posts:
    3
    Hey scottyboy805,

    I have a question that you may know the answer to right away. Is there an ability to stream replay data to another computer in real time? Right now most examples I saw need to stop recording and require a full either file or memory location on the same machine to start the replay. Is there something in the design of Ultimate Replay that allows me to continuously stream and fetch the data in chunks over the network. I can take care of the networking part but just wondering if the design of Ultimate Replay prohibits it. Both machines will run the same executable.

    Thanks in advance.
     
  39. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi,
    At the moment there is no easy way to do this. You could possibly create a custom storage target based on the ReplayMemoryTarget which sends snapshots over the network but it would require some work and testing to get it right. In theory it should work just fine as long as it is recreated properly on the receivng side and this will allow you to playback on another device while still recording on the sending device. We are currently working on Ultimate Replay 2.0 which supports saving to streams although the recording must end before playback can begin so this may not be what you need either.
     
  40. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Ultimate Replay 1.2.1 has been submitted to the asset store. This version fixes a bug in the replay file target where the current scene name would not be stored correctly causing an empty string to be returned in some cases.
     
  41. ArteastUFO

    ArteastUFO

    Joined:
    May 19, 2017
    Posts:
    10
    Hi, @scottyboy805
    First of all thank you for great asset!

    I have issue with replaying events. I made script based on your "ReplayAudio" script. It record's when I changing material of the given object.
    It's working as intended, but sometimes it's not working. Let say it works 7 times out of 10.

    I tried to increase "Record FPS" on replay manager, tried on all "Update Methods". But the result still the same for now. Can you please give direction how to solve this issue?
     
  42. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi,
    Glad you like the asset.

    The problem you mention is a know issue and is actually a design flaw in the asset. We discovered it a while ago but found that it would take major refactoring to fix the issue definitivley. The issue occurs when the game framerate is too low, the playback speed is too high, or if the record frame rate is too high. Playback is essentially a series of scene snapshots kind of like a slide show and it is possible for one or more frames to be skipped if one of the mention conditions applies. Since the event data is stored with an associated snapshot, it is also possible to skip event data as you are seeing.

    We are working on Ultimate Replay 2.0 at the moment which will fix this issue for good by simulating missed frames and 2.0 is currently in open beta so should be coming soon. In the meantime though I would recommned using the OnReplaySerialize and OnReplayDeserialize methods to store the necessary data such as material ID or similar. Alternativley you may be able to use a replay variable in some way to store your material information but it will depend on what exaclty you are saving. You could also try reducing the record fps which would be a hacky way of possibly fixing the problem. Increasing the recording fps will actually make the problem worse as the time difference between frames becomes smaller and there is more chance to miss a frame.

    I hope this helps you. Let me know if you have any more questions or there is anything else.
     
    ArteastUFO likes this.
  43. ArteastUFO

    ArteastUFO

    Joined:
    May 19, 2017
    Posts:
    10
    Thank you, reducing the record fps really helped! Will wait for 2.0 version for now :)
     
  44. ArteastUFO

    ArteastUFO

    Joined:
    May 19, 2017
    Posts:
    10
    Hello again, @scottyboy805
    Can't figure out how to call method every time when replay is starting again in loop mode.
    I tried "OnReplayStart" and "OnReplayEnd" but they working only when game enters or exits replay mode.

    What I want is just change the camera every time when recorded replay is starting play from the beginning. This way want to show same replay in different angles.

    Can you please help with this situation?
     
  45. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi again,
    There is no easy way to do this at the moment. As you have discovered, the replay Start and End events are only called when entering and exiting playback mode and not when playback restarts automatically. The source code could be modified quite easily to call the replay Start event when playback loops around. If you take a look in the source file 'Assets/UltimateReplay/Scripts/Core/ReplaySequencer.cs' at line '203' you should see the following code:

    Code (CSharp):
    1. if (playbackTime >= target.Duration || playbackTime < 0)
    2. {
    3.     playbackTime = (direction == PlaybackDirection.Forward) ? 0 : target.Duration;
    4. }
    If you modified that code like so, you should find that the start event now gets called when the replay loops around:

    Code (CSharp):
    1. if (playbackTime >= target.Duration || playbackTime < 0)
    2. {
    3.     playbackTime = (direction == PlaybackDirection.Forward) ? 0 : target.Duration;
    4.                          
    5.     // Broadcast the replay start event
    6.     ReplayBehaviour.Events.CallReplayStartEvents();
    7. }
    We can see how this could be a useful feature though so we will add this behaviour to the next update.
     
  46. ArteastUFO

    ArteastUFO

    Joined:
    May 19, 2017
    Posts:
    10
    Thank you very much scottyboy805! It works.
     
    scottyboy805 likes this.
  47. MikhaskoS

    MikhaskoS

    Joined:
    Jun 24, 2018
    Posts:
    52
    Hi. Ultimate Replay can simultaneously record and play back the movement of different objects?
    I installed the asset, but haven't managed to figure it out yet. However, I noticed that there were warnings and errors during installation. ReplayFileTargetDemo also works with errors (I will probably clarify the details later).
     
  48. scottyboy805

    scottyboy805

    Joined:
    Apr 10, 2013
    Posts:
    1,195
    Hi,
    Ultimate Replay can only record or replay at the moment and not both at the same time. Our upcoming asset Ultimate Replay 2.0 will fully support this though and should hopefully be released soon if all goes well. You can read more about the new asset here.

    You should not be getting any errors or warnings so we would be interested to see what those message are so we can fix them. It would also help if you could let us know which Unity version you are using.
     
  49. MikhaskoS

    MikhaskoS

    Joined:
    Jun 24, 2018
    Posts:
    52
    Hi,
    Screen1.jpg Screen2.jpg
     
  50. MikhaskoS

    MikhaskoS

    Joined:
    Jun 24, 2018
    Posts:
    52
    Unfortunately, version 1 has little functionality. We will wait for version 2.
    I hope you won't have any singletons in version 2.
     
    Last edited: Aug 19, 2020