REWIND TIME in Unity

Поделиться
HTML-код
  • Опубликовано: 20 июн 2017
  • In this video we create a reverse time effect!
    ● Download the scene: github.com/Brackeys/Rewind-Time
    ● Download Chronos - Time Control: www.assetstore.unity3d.com/#!...
    ❤️ Donate: www.paypal.com/donate/?hosted...
    ····················································································
    ► Join Discord: / discord
    ♥ Subscribe: bit.ly/1kMekJV
    ● Website: brackeys.com/
    ● Facebook: / brackeys
    ● Twitter: / brackeystweet
    ········································­­·······································­·­····
    Edited by the lovely Sofibab.
    ········································­­·······································­·­····
    ► All content by Brackeys is 100% free. I believe that education should be available for everyone. Any support is truly appreciated so I can keep on making the content free of charge.
    ········································­­·······································­·­····
    ♪ Baby Plays Electro Games
    teknoaxe.com/cgi-bin/link_code...

Комментарии • 816

  • @nekit8742
    @nekit8742 4 года назад +452

    Everyone participating in Brackeys Game Jam 2020: OH YES, REWIND TIME

  • @etaxi341
    @etaxi341 7 лет назад +498

    you shuld store the rigidbody velocity too so it flys in the same direction again after the rewind

    • @t.wood01
      @t.wood01 7 лет назад +18

      Great idea! I was just getting ready to ask about how to make the objects continue flying after the rewind.

    • @1234macro
      @1234macro 7 лет назад +3

      You would only need to store this once, and change it after each new point.

    • @viktorkrasovskyi7837
      @viktorkrasovskyi7837 7 лет назад +29

      don't forget about angular velocity too ;)

    • @jacobmakob1
      @jacobmakob1 7 лет назад +37

      I've gone with:
      above the TimeBody class
      public struct PointInTime
      {
      public readonly Vector3 position;
      public readonly Quaternion rotation;
      public readonly Vector3 velocity;
      public readonly Vector3 angularVelocity;
      public PointInTime(Transform t, Vector3 v, Vector3 aV)
      {
      position = t.position;
      rotation = t.rotation;
      velocity = v;
      angularVelocity = aV;
      }
      }

    • @jacobmakob1
      @jacobmakob1 7 лет назад +26

      Then I run this at the end of StopRewind:
      void ReapplyForces() {
      rb.position = pointsInTime[0].position;
      rb.rotation = pointsInTime[0].rotation;
      rb.velocity = pointsInTime[0].velocity;
      rb.angularVelocity = pointsInTime[0].angularVelocity;
      }

  • @Brackeys
    @Brackeys  7 лет назад +227

    To those of you who want to make this code more performant here are a few things to keep in mind:
    - Because we are only storing simple values, consider using a struct instead of a class.
    - Because we are "overwriting" values consider using an array with a fixed length and then simply swapping in/out values when we reach the end of the array.
    Using generic lists is handy but will always be slower than an array with a given size.
    Also to those of you who suggest using a Stack. This makes perfect sense and was actually what I started by using. However we do need the ability to overwrite values and therefore we need to access items at the bottom of the list which a stack by definition won't do. Please do let me know if there is any way to make this code run faster using a stack vs. an array :)
    Hope you guys like the video! :)

    • @selvexfu
      @selvexfu 7 лет назад +23

      I posted this as a comment already, but I will paste it here since you seem to be interested in it.
      Performance tweek: as some already mentioned lists are not optimized for this usecase (intel focuses on lists so it's still lightning fast, but there are better solutions)
      The thing that fits this purpose perfectly would be a LinkedList. It provides you with removeLast() and addFirst() out of the box and is sickengly optimized for manipulating the start and the end of the list.
      Love your videos. Thanks.

    • @TheMasterpikaReturn
      @TheMasterpikaReturn 7 лет назад +2

      are C# lists actually ArrayLists? because when i see "list" i immediately think about LinkedList, which should be quite good for this case (because prepending is O(1), iirc). I guess using an Array would work too, but it feels more awkward to me(if we insert stuff at the start)

    • @iammichaeldavis
      @iammichaeldavis 7 лет назад +13

      Also adding to the end of the lists instead of inserting into the front is way more efficient: stackoverflow.com/questions/18587267/does-list-insert-have-any-performance-penalty
      Thanks so much for this technique. Love your videos!

    • @darkhummy
      @darkhummy 7 лет назад +14

      Could also only record every 2 or more fixedtimestep steps and lerp between each point if you really needed optimization.

    • @georgy028
      @georgy028 6 лет назад +15

      The best performance would be if you use a fixed length circular array (also called circular buffer) so you do not have to rearrange values just change the pointers (start and end) whenever you add or remove values

  • @RumbleKnightYT
    @RumbleKnightYT 4 года назад +185

    Brackeys: Makes a game jam with the topic rewind
    Me: (uses their own tutorial on it)
    *STONKS*

  • @epicbladeunity4285
    @epicbladeunity4285 4 года назад +148

    Who is here for the Brackeys Jam Theme : Rewind and getting help like i am!!

    • @sekunriruisen506
      @sekunriruisen506 4 года назад +3

      Gotta use what resources you have access to

    • @mithunmmurthy1473
      @mithunmmurthy1473 4 года назад +3

      I thought I am first from the game jam 😂😂

    • @epicbladeunity4285
      @epicbladeunity4285 4 года назад

      @@sekunriruisen506 trueeee

    • @RumbleKnightYT
      @RumbleKnightYT 4 года назад +5

      Brackeys: Makes a game jam with the topic rewind
      Me: (uses their own tutorial on it)
      *STONKS*

    • @alejandrohaynes81
      @alejandrohaynes81 4 года назад

      i'm 14 and this is deep, they literally made the theme about a brackeys video that already exists

  • @RitobanRoyChowdhury
    @RitobanRoyChowdhury 7 лет назад +277

    One thing I'd like to point out is that when Brackey's mentions that with 50 cubes, you're already storing 2,500 values, its not actually that much.
    Each point in time is a Vector3 and a Quaternion. The Vector3 is 3 floats, the Quaternion is 4. Each float is 4 bytes.
    That means each point in time is (3+4)*4=28 bytes. Unity can easily handle tens of thousands of 28 byte classes.
    If we take the scenario here, we have 50 cubes and we are recording 50 times per second. In one second:
    50*50*28 = 70,000 bytes
    70,000 bytes = ~68 kilobytes.
    In comparison, a 512x512 png image is 1027 kilobytes.
    In this scenario, you're loading in a small png sprite every ~15 seconds. That's nothing, even on a mobile device. You probably aren't ever going to rewind longer than 10 seconds, so you're not even loading a full png image into RAM ever.

    • @davidkoffi985
      @davidkoffi985 7 лет назад +5

      Ritoban Roy Chowdhury SMART

    • @Laflamablanca969
      @Laflamablanca969 7 лет назад +36

      Ritoban Roy Chowdhury yeh the storing of the values isn't much space but having 50 objects that have a script on them with both update and fixed update is unnecessary. It's a good video for beginners to understand the concept but I certainly wouldn't implement it this way.

    • @ItsGlizda
      @ItsGlizda 7 лет назад +2

      What would you do instead? Store all the data inside one manager script?

    • @davidkoffi985
      @davidkoffi985 7 лет назад

      La Flama Blanca there isn't another way to do it. that would be better necessarily

    • @RitobanRoyChowdhury
      @RitobanRoyChowdhury 7 лет назад +20

      I would store all the data inside a manager script. Unity can easily manage tens of thousands of simple game objects with renderers (see: quill18creates Project Porcupine Episodes 1-3). However MonoBehaviours have quite a large overhead (moreso when compared to just a GameObject or Transform Reference), making is significantly less memory.

  • @makra2077
    @makra2077 4 года назад +79

    Brackeys game jam 4 goes brrrrrrr

  • @VperVendetta1992
    @VperVendetta1992 6 лет назад +1

    I was looking for a tutorial like this for years. The presentation from the Braid videogame developer was the only thing I could find, but this is way better and more detailed. Thank you so much.

  • @vectozavr
    @vectozavr 3 года назад +37

    In PointInTime class you can add information about velocity and angular momentum to set the same velocity as it was at each particular moment (to get rid of the problem when cube after rewinding just falling down)

    • @JesseTheGameDev
      @JesseTheGameDev 3 года назад +2

      This would be a fantastic addition to this.

    • @TheIronicRaven
      @TheIronicRaven 3 года назад

      How does one add the velocity and angular momentum? I mean what are the parameters? Just rigidbody.velocity? And rigidbody.angle?

    • @silent1um706
      @silent1um706 3 года назад

      Sometimes my boxes still falling down after rewind ( what could cause this problem?

    • @TheIronicRaven
      @TheIronicRaven 3 года назад

      @@silent1um706 is your gravity still on? On the rigidity. That would cause it fall when you are done rewinding

    • @atlasua2021
      @atlasua2021 3 года назад +1

      Привет) ты бы мог сделать игру с регрессией времени) было бы любопытно.

  • @cbox_
    @cbox_ 7 лет назад +1

    Long time viewer Brackeys, love your vids. You explain things so perfectly. Definitely the best out there.

  • @zannleft7117
    @zannleft7117 7 лет назад +52

    I'm dead fucking serious I searched for this yesterday and nothing came up. Thank you sooo much for reading my mind

    • @prototypeinheritance515
      @prototypeinheritance515 6 лет назад

      there is a wonderful talk by jonathan blow on his game braid and his implementation of a rewind mechanic. He recorded up to a half hour of game

  • @KelvinCipta
    @KelvinCipta 4 года назад +18

    Brackeys theme : rewind
    Me : ok, let's watch this again

  • @abdelhaksaouli8802
    @abdelhaksaouli8802 4 года назад +34

    i wonder how many view this video will get after the 2020 summer jam ends x')

  • @adityansah
    @adityansah 4 года назад +16

    Here during Brackeys Jam 2020.2

    • @se9979
      @se9979 4 года назад +1

      well... The program doesnt work for me, did it work for you?

    • @kidjuke6262
      @kidjuke6262 4 года назад

      Any got ideas to spare for the game jam

  • @benjohnson7610
    @benjohnson7610 7 лет назад

    Very nice and simple tutorial, I can see a lot of new developers making great use of this. One tip for anyone who wants the replay to continue as normal, be sure to save the current velocity of the rigidbodies as well as their positions and rotations. This way when you finish your rewind the explosions will still happen as expected. You may also need to keep track of more advanced things like timed events that you trigger at certain times such as sphere casting for a grenade explosion, or variables that could be effected. For advanced objects you will probably want to make a subclass of the basic script that records this extra data.

  • @caedriel5555
    @caedriel5555 6 лет назад

    Seeing this reminded me of a project we did initially in our degrees where we did the same thing however we saved X amount of vector 3 positions to demonstrate our understanding of lists & stacks

  • @armo0375
    @armo0375 7 лет назад

    This will be so useful in racing games! Thanks for the tutorial man!

  • @Rawbful
    @Rawbful 6 лет назад

    So weird you have a video on this. I was just thinking about how Braid might have done what they did with time rewinding and this understanding certainly helps!

  • @georgeoutters5657
    @georgeoutters5657 6 лет назад

    Brackeys you are such a pro. I love your videos. I'm learning so much!!!!

  • @NavedAhmadX
    @NavedAhmadX 5 лет назад

    I'm learning unity engine and your channel is helping a lot. Also. Blackthornprod's channel is very helpful as well

  • @vandameh.a2235
    @vandameh.a2235 4 года назад +2

    I am studying video game programming and your videos are my inspiration to not stop chasing my dream.
    A M A Z I N G
    BTW: I have completed succesfully your tutorials of tower defense and rpg!! Thanks you very much

  • @charlie2915
    @charlie2915 4 года назад +30

    Me when GameJam

  • @fachri17
    @fachri17 4 года назад +10

    came here for the jam

  • @Lanvill
    @Lanvill 7 лет назад

    Wow, you made that look very easy. Love it.

  • @maxofcourse
    @maxofcourse 7 лет назад +3

    Couldn't wait for this video to come out after it was leaked a while ago

  • @SuperRalle123
    @SuperRalle123 7 лет назад +1

    Really well made video, thanks for the hard work; It makes it all the more worth being a patreon.
    I would love to see a tutorial like this on how animations work, it could possibly fit together with your blender series!

    • @CamperGuy
      @CamperGuy 7 лет назад +1

      Rasmus Tollund I would love to see this video. Nice to see other patreons as well ^.^

  • @cyclicyttrium4318
    @cyclicyttrium4318 7 лет назад

    You and your patreons are awsome :)

  • @odmehbb
    @odmehbb 3 года назад

    First of all, I love your videos, thanks for all the stuff I've learned. You should consider using a Stack instead of a List. That structure is exactly for this kind of approach. Also, if you stop rewinding in the middle, and record additional positions, you will still be able to rewind to the beginning afterwards.

  • @davidreichenbach6679
    @davidreichenbach6679 7 лет назад +1

    Really inspiring video. Plenty of stuff to do with this, thanks!

  • @domizzp.2785
    @domizzp.2785 7 лет назад +63

    Suggestion for future tutorials: before the tutorial do a quick showcase of how you are going to achieve the effect. For example here before you start programming just say we are going to rewind time by storing the positions and rotations of each object at some time rate and then setting them back... You get the idea :D. Some people are just interested in HOW to do something and they can do the programming part themselves :)

  • @simoncodrington
    @simoncodrington 5 лет назад

    Great video man. Really enjoyed it :)

  • @oleksiy1752
    @oleksiy1752 6 лет назад

    Thank you very much for this! you really saved like a day for me!

  • @Oxmond
    @Oxmond 4 года назад +1

    Cool stuff! Great Tutorial! ❤️

  • @spounka
    @spounka 7 лет назад

    holly shit i was thinking of it this morning, man you are great, RESPECT

  • @Dasheon
    @Dasheon 4 года назад +155

    We all know why you're here

    • @GavinBot
      @GavinBot 4 года назад +5

      Game jam lol

    • @David-vz4yk
      @David-vz4yk 4 года назад

      ItsMeDash2 agreed

    • @TheLoveMiku
      @TheLoveMiku 4 года назад

      Can someone please tell me if the empty Game object named Cubes has some components to it?

    • @nullreferenceexception1448
      @nullreferenceexception1448 4 года назад +9

      I'm actually here cause I find it interesting. The coding seems easy but i'm too lazy to do anything in Unity.. Or even install Unity.

    • @Sylfa
      @Sylfa 4 года назад

      More like, RUclips is now recommending this cause of all you lot going here to watch it for the gamejam...

  • @daaajjyx8351
    @daaajjyx8351 4 года назад +1

    Perfect! Now I’ll know how to rewind in the game Jam!

  • @sylvainatoz2045
    @sylvainatoz2045 6 лет назад

    Wow! Very well explained. Thanks.

  • @Wardy125
    @Wardy125 6 лет назад

    You are the best person on the internet.

  • @LilBigHuge
    @LilBigHuge 6 лет назад

    Such a great tutorial! Thank you!

  • @timmyward349
    @timmyward349 4 года назад

    This is a GREAT mechanic for a video game. In fact, I know a few video games that do this.

  • @Lucavon
    @Lucavon 4 года назад

    I did this yesterday. Now I found this tutorial. Turns out our ideas were exactly the same, I implemented it the exact same way (except for not setting the Rigidbodies kinematic, and just disabling their gravity instead). I also added interpolation for high-refresh-rate monitors, but other than that, it's the same!

  • @imperialdynamics5346
    @imperialdynamics5346 6 лет назад

    another excellent video from Brackeys. I don't understand why some people downvoted again! (oh well, internet)

  • @whyisthismyname6258
    @whyisthismyname6258 6 лет назад

    I love Brackeys' tutorials

  • @BillyMan
    @BillyMan 4 года назад +21

    Anyone watching this cuz of Brackeys Jam 2020.2 :) ?

    • @CreatePlayGames
      @CreatePlayGames 4 года назад

      Do we need to use unity3d 2020.2 version for this?

    • @CreatePlayGames
      @CreatePlayGames 4 года назад

      BTW im planning to join this game jam thats why im asking :)

  • @siank7322
    @siank7322 7 лет назад

    Brackeys...you are the best

  • @gregorymccardle4004
    @gregorymccardle4004 6 лет назад +27

    When you said C sharp I just though of instruments and my instrument and I almost snapped into position....

  • @pedroprass106
    @pedroprass106 4 года назад +17

    Imagine if Brackeys Jam had the rewind theme just so he could increase the view count in this video e.e

    • @youssefkassem4895
      @youssefkassem4895 4 года назад

      have you got a game idea? for the jam

    • @David-vz4yk
      @David-vz4yk 4 года назад

      Youssef Kassem I know a friend on yt called Part-time toaster, he really smart and makes devlog, he Will probably make a devlog out of the jam

  • @muhseng9838
    @muhseng9838 4 года назад +100

    anyone here from the brackeys 2020 game jam ?

  • @atlasentinel
    @atlasentinel 7 лет назад +1

    Thanks for your tutorial because since 2 years , I search a video of this type. And You should make a series of tutorial about controll time , like a " bubble of time where there are another timeline in the area

  • @RugbugRedfern
    @RugbugRedfern 7 лет назад +7

    To keep the velocity of the cube:
    (This is from another one of my posts)
    *In the PointInTime class:*
    public Vector3 position;
    public Quaternion rotation;
    public Vector3 velocity;
    public Vector3 angularVelocity;
    public PointInTime(Vector3 _position, Quaternion _rotation, Vector3 _velocity, Vector3 _angularVelocity) {
    position = _position;
    rotation = _rotation;
    velocity = _velocity;
    angularVelocity = _angularVelocity;
    }
    *Then in StopRewind() just add the code*
    GetComponent().velocity = pointsInTime[0].velocity;
    GetComponent().angularVelocity = pointsInTime[0].angularVelocity;
    *Just make sure the last pointInTime isn't deleted*
    *I just did this*
    if(pointsInTime.Count > 1) {
    PointInTime pointInTime = pointsInTime[0];
    transform.position = pointInTime.position;
    transform.rotation = pointInTime.rotation;
    pointsInTime.RemoveAt(0);
    } else {
    PointInTime pointInTime = pointsInTime[0];
    transform.position = pointInTime.position;
    transform.rotation = pointInTime.rotation;
    }
    *Also gives the nice effect of when you've completed rewinding, it just freezes time until you let go of the return key.*

    • @rodrigobronselli59
      @rodrigobronselli59 7 лет назад +1

      What about animations? Can I implement this on characters too?

    • @RugbugRedfern
      @RugbugRedfern 7 лет назад

      I'm not sure... There might be a way.

    • @janlos202
      @janlos202 Год назад

      Hello, i do what u wrote but its not working ;// . pointsInTime.Insert(0, new PointInTime(transform.position, transform.rotation) ); i Have problem here, please help!

  • @Lobobobo123
    @Lobobobo123 4 года назад +11

    Hi, fellow Game Jammer :)

  • @AlexVoxel
    @AlexVoxel 7 лет назад +1

    I was wondering how to do this, thank you very much!

  • @creativeworks98
    @creativeworks98 7 лет назад

    wow thank you so much for this wonderful tutorial

  • @CamperGuy
    @CamperGuy 7 лет назад

    Already looking forward to add this to my project

  • @somerndhmn
    @somerndhmn 5 лет назад +10

    Yaaaaaaa...
    IT'S REWIND TIME!

  • @dorotikdaniel
    @dorotikdaniel 7 лет назад +35

    Very nice tutorial. Just make sure not to use List in this case, since Insert needs to shift all elements internally [O(N)], while Add does not [O(1)]. For example, when I ran insertion of 100000 items into List, it took 2.1sec, while addition took 0.003sec! Easiest would be to use LinkedList, where both insertion and removal are O(1) operations. Cheers!

    • @vinidotnet
      @vinidotnet 7 лет назад

      Thanks for pointing this out. In the end performance matters and using Queue or LinkedList could make this code a lot more efficient.

    • @pfarnach
      @pfarnach 7 лет назад

      I don't doubt your research, and I'm new to C# myself, but some quick googling says that Linked Lists in C# are usually slower than Lists, except, sometimes, in the case of random insertions.
      stackoverflow.com/questions/5983059/why-is-a-linkedlist-generally-slower-than-a-list

    • @vinidotnet
      @vinidotnet 7 лет назад +7

      In our specific case we just need 2 major operations in our list to make rewind works.
      1. To make sure we record only 5 seconds we constantly need to remove the last item of the list. Both LinkedLists and Lists will have the same performance in this operation (maybe Lists are a little faster since LinkedLists also need to deal with memory management, but to be honest it's not too relevant).
      2. We have to constantly record the movement and INSERT it at the BEGINNING of the list. Here's when Lists become expensive. Every time you insert at the beginning of the List it will shift every other item to adjust indexes.
      You basically saying "Hey List, put this guy at the beginning (first position number 0)" then the List will answer "Okay, but since we already have someone at this position we first need to move him to the next room and do this to every guy after him".
      The same applies when we turn on our rewind. We will be removing items from beginning and the List will need to adjust indexes again.
      This is when LinkedLists become useful. It does not have indexes, so if we need to insert at the beginning of the list it will simple create it in memory and will link it to the next item that was previously our first element.
      The point is: Inserting at the end both are similar but since we need to CONSTANTLY insert items at the beginning of our array, List will CONSTANTLY shift ALL items to adjust indexes. Imagine every frame we having to move every item in the list. Meanwhile with LinkedLists we will worry only with adding and removing.
      See this answer in the same topic that you shared: stackoverflow.com/a/5983207.
      My English isn't that good, sorry in advance. Hope this explains your question. If you want to lean more you can search "doubly linked lists data structure" and "big-o notation".

    • @jymmy097
      @jymmy097 7 лет назад +2

      ...Or if you wanted to have a more abstracted representation, I'd have used a Stack.

    • @vinidotnet
      @vinidotnet 7 лет назад +1

      Stack won't work properly since we need to remove from the bottom of our list constantly to hold only 5 seconds of data. Stack is LIFO (last in, first out) which means that it can only remove data from the top of the list.

  • @WingedNova
    @WingedNova 7 лет назад

    Keep up the Awazing Work!!!

  • @sajrapraveen4963
    @sajrapraveen4963 4 года назад +11

    Hey I am from Future,
    I came here to tell you that your tutorial will help in your forth game jam themed Reverse
    Thank you

    • @CreatePlayGames
      @CreatePlayGames 4 года назад

      hi, future, when is the deadline for this?

    • @sajrapraveen4963
      @sajrapraveen4963 4 года назад +1

      @@CreatePlayGames 8 August 3:30 PM according to Indian Standred Time

    • @CreatePlayGames
      @CreatePlayGames 4 года назад

      @@sajrapraveen4963 tnx, hows ur progress?

  • @jummagamedeveloperbeginner6509
    @jummagamedeveloperbeginner6509 4 года назад

    I didn't understood the full code, but I saw it worked!

  • @andre.drezus
    @andre.drezus 7 лет назад

    Nice, now I can finally get a headstart in my Clock Blockers based game

  • @mpattym
    @mpattym 6 лет назад +1

    Very cool video, i personally don't use unity (i prefer ue4) but the logic you went through was well explained and can be applied to any game engine.
    For those that are using physics objects you may also want to track the objects velocity. This way objects will continue along there path instead of just dropping when you stop rewinding time.

  • @ekimyukselbaba8847
    @ekimyukselbaba8847 3 года назад +1

    This is killer queen's third ability: bites the dust!!!!

  • @blekcode1416
    @blekcode1416 4 года назад +3

    Lmao, now everybody will be here cause of the jam :D

  • @TomtheMagician21
    @TomtheMagician21 3 года назад

    The way he explains why he does everything is so helpful and especially since it doesn't slow the video down so it'd fast but still followable

  • @P4D3LL05
    @P4D3LL05 7 лет назад

    Cheers love, the cavalry is here

  • @-therebirth7757
    @-therebirth7757 6 лет назад

    Finally the actual tutorial about making a replay system.

  • @cindychen0204
    @cindychen0204 6 лет назад

    great work!!

  • @Guyonahi
    @Guyonahi 7 лет назад

    Good video and crystal clear explanation as always. Now show how you do it for the particle system :P

  • @NoStupidItsManbearpig
    @NoStupidItsManbearpig 2 года назад

    Thanks Brack :D

  • @technoo4891
    @technoo4891 4 года назад

    Damn, this is amazing, could convert this to 2D and had some cool results

  • @thesmileynoob
    @thesmileynoob 7 лет назад

    thanks! this was a great tutorial.

  • @selvexfu
    @selvexfu 7 лет назад +1

    Performance tweek: as some already mentioned lists are not optimized for this usecase (intel focuses on lists so it's still lightning fast, but there are better solutions)
    The thing that fits this purpose perfectly would be a LinkedList. It provides you with removeLast() and addFirst() out of the box and is sickengly optimized for manipulating the start and the end of the list.
    Love your videos. Thanks.

  • @kshitijvashistha5457
    @kshitijvashistha5457 7 лет назад +8

    How can you find things like this

  • @JuniorDjjrMixMods
    @JuniorDjjrMixMods 4 года назад +1

    In addition to the low performance due to the use of List.Insert(0,*), your solution is dependent on FPS to work correctly.

  • @MrKraignos
    @MrKraignos 7 лет назад

    A tip if you want to edit your private fields in the inspector without making them public, you should use the tag [SerializeField]. Making a field public *only to see it in Unity* is a shame that breaks the encapsulation offered by POO, and could lead to chaos later if your project becomes bigger. Have a nice day.

  • @toastape5298
    @toastape5298 7 лет назад +1

    @Brackeys - Also have to record physics' velocities (both positional and rotational) and add them back to the objects after disabling kinematics flag, so that objects obey inertia after going out of the rewind (unless that sudden "stop in midair" at 13:10 is intended behavior =P).
    Other than that, perfect tutorial! =)

  • @F3ND1MUS
    @F3ND1MUS 7 лет назад +1

    lol nice work sir!

  • @andrewkerr9438
    @andrewkerr9438 7 лет назад

    So that show to rewind time, THAT'S SO COOL

  • @themannyzaur
    @themannyzaur 6 лет назад

    That intro had me hooked

  • @mnordpol7805
    @mnordpol7805 2 года назад

    Cool stuff!

  • @In-N-Out333
    @In-N-Out333 4 года назад +1

    I haven't tried this, but in C#7, you can use tuples to create a list that holds both positions and rotations. So it may not be necessary to create a class to hold those two data types.

  • @ninojanjeremygo463
    @ninojanjeremygo463 6 лет назад +4

    Wow, when I saw that rewind uoısoןdxǝ, what's in my mind it's like a, sort of, Prince of Persia game!

  • @auron2900
    @auron2900 7 лет назад

    +1 for the rename shortcut

  • @outis99
    @outis99 7 лет назад

    Finally you reuploaded!!!

    • @leonlaci9162
      @leonlaci9162 7 лет назад

      The Oncoming Storm Not really a reupload. That time he accidentally posted.

  • @glassystudio
    @glassystudio 4 года назад +30

    Whos here for the jam??

  • @neverknowsbezt
    @neverknowsbezt 7 лет назад +1

    Maybe you could store position and rotation every 0.1 sec, then use translate to move object to that position. You save lot of intermediate positions and rotations. Also, as etaxi341 said, you could store the rigidbody velocity so it keeps moving in the same direction when you release the rewind button.

  • @tPlayerioT
    @tPlayerioT Год назад

    A game that tries to push forward and make a rewind of 1minute will be god tier

  • @Serlith
    @Serlith 6 лет назад

    Can't wait to try it out with the new ECS system.

  • @ozi-g-be
    @ozi-g-be 4 года назад

    Well this video is about to blow up

    • @PDCMYTC
      @PDCMYTC 4 года назад

      Yeah Lol

  • @adicsbtw
    @adicsbtw 4 года назад

    I feel like you should also store the velocity so that when the rewinding ends you can give it the velocity at that point in time.

  • @unessoum8335
    @unessoum8335 7 лет назад

    thanks bro you are awesome

  • @starinsky2873
    @starinsky2873 6 лет назад

    Great tutorials thank u unity

  • @knightshousegames
    @knightshousegames 5 лет назад +54

    I wanna use the Any key, but it looks like my keyboard doesn't have that one. Theres so many games I can't play because they want me to press the Any key to begin...

    • @TheUncutAngel
      @TheUncutAngel 5 лет назад +3

      i got my dick stuck in the fan, too

    • @kylefnreal5794
      @kylefnreal5794 4 года назад +1

      @@TheUncutAngel r/cursedcomments

  • @fatihbatuhantokar8999
    @fatihbatuhantokar8999 3 года назад

    Ty for video !

  • @billgreen9866
    @billgreen9866 7 лет назад +6

    can you make a guide on how to make a save and load function

  • @MaeveFirstborn
    @MaeveFirstborn 7 лет назад

    To add on to this, I'd add a curve value that allows it to slow down to a halt, and then move slowly back, but at the value of the curve, ie, moving back faster the longer it's being done.

  • @ResoCoder
    @ResoCoder 7 лет назад +1

    Thanks for the tutorial! However, using Insert repeatedly is not very optimal. It has to move all of the elements, so just a simple Add() at the end of the list is the best way to do this.

  • @ZarkowsWorld
    @ZarkowsWorld 5 лет назад

    6:27 - learn usage of guard-clauses. Check if the amount is zero, then set the status that we are no longer in rewind and return.

  • @Treyzania
    @Treyzania 7 лет назад +1

    I believe that PointInTime should be a struct, not a class. That way it can be copied around and you won't have to worry about load from GCing them later.

  • @mrvirtual3928
    @mrvirtual3928 6 лет назад +1

    @Brackeys
    you said a swear 13:47
    haha made my day