Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Save replays in unity.

Discussion in 'Editor & General Support' started by pengyj1984, Mar 4, 2010.

  1. pengyj1984

    pengyj1984

    Joined:
    Jun 21, 2009
    Posts:
    58
    As the title. Can I save replays in unity.
    Any suggestion is fine. Thanks
     
  2. carnevalle

    carnevalle

    Joined:
    Jun 25, 2009
    Posts:
    39
    I second that. :)
     
  3. CoatlGames

    CoatlGames

    Joined:
    Apr 25, 2008
    Posts:
    773
    i suppose you can if you know how to do it, unfortunately i dont.

    but i have seen it done , the game time donkey in blurst.com , uses a feature similar to replays which represents what you did before as a ghost.. it can play many versions of what you did before at the same time and having some kind of self co-op hahahaha
     
  4. RobbieDingo

    RobbieDingo

    Joined:
    Jun 2, 2008
    Posts:
    484
    The usual technique for a replay would be that you append the position and rotation data (and any other stuff you need) for the player's 'character' (be it car, spaceship, or whatever) to an Array upon each update (or at some other stepped interval).

    Then on re-play you just run back through the array applying the data back to the character's various attributes.

    In some cases you may well not need to do this every update or fixedUpdate as taking a sample at longer intervals and lerping the result might be possible?

    Another possible technique might be to store the user's input instead (ie. the joystick and fire buttons or whatever). But if you are using Physics, I would advise against this as the results might not be exactly the same on replay...
     
  5. pengyj1984

    pengyj1984

    Joined:
    Jun 21, 2009
    Posts:
    58
    In my situation, is a character shoot a ball by an played back an animation, then the ball's track. For the ball's track, I think this is a solution. For the character animation, I think I have to animate it again.
    I'll just try this.