How to make Slow Motion in Unity - Bullet Time Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

ความคิดเห็น • 441

  • @MaeveFirstborn
    @MaeveFirstborn 8 ปีที่แล้ว +107

    The recording seems a lot smoother than normal! Good Job!

  • @benjohnson7610
    @benjohnson7610 8 ปีที่แล้ว +412

    Should have also mentioned the need to adjust animators to use unscaled time. Bringing this type of slow motion effect into any game that uses them (for example maybe you have a rotation weapon selection wheel in a shooter or an in game weapon modification screen) the animations will also be slowed down by the same rate as bullet time. If anyone has this issue like I did when I tried a similar effect long ago, change the "Update Mode" on the animator from "Normal" to "Unscaled Time".

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +103

      That's a good point! Completely forgot about it because I had no animators in the example scene :) Pinned!

    • @Daftsins
      @Daftsins 8 ปีที่แล้ว +15

      Is there some way to slow down time for some tag only? It could make an awesome effect...

    • @benjohnson7610
      @benjohnson7610 8 ปีที่แล้ว +9

      You can kind of do that by creating a script that changes the objects speed and animators speed but this wont work on Physics. Unfortunately Physics in Unity is kind of all or nothing and if you want to customize it in this way you'll need to make your own solution. You'll really just need to implement your own movement speed (should be easy for a character), gravity, and adjust the animators as needed.

    • @lukasthompson8299
      @lukasthompson8299 8 ปีที่แล้ว +3

      I didn't see this until now and just asked a similar question. That's what I figured was you would have to do something like While slowMotion = true, playerSpeed = 20, else playerSpeed = 10. Thanks for the info about the animations too, I would have been like wth is wrong with this crap. Going for that X-Man effect in my game and between your information and this video I should be able to add the next ability to my character.

    • @mr.mysteriousyt6118
      @mr.mysteriousyt6118 8 ปีที่แล้ว +5

      when I restart the scene the time is still slowed how can I fix that

  • @ZacharyAghaizu
    @ZacharyAghaizu 3 ปีที่แล้ว +1

    Lovely!! SO excited to use this effect in my ar music app

  • @bariscanyilmaz
    @bariscanyilmaz 3 ปีที่แล้ว +1

    this guy amazing. whenever i look something for unity every time i come up with this guy. I miss you man :/

  • @infinityplays2296
    @infinityplays2296 4 ปีที่แล้ว +26

    For everyone experiencing issues with the physics after adding the slow motion:
    The issue is, that fixedUpdate doesn't slow down simultaneously with the timeScale. I fixed this in my code (not the prettiest, pls don't judge):
    public class TimeManager : MonoBehaviour
    {
    public float slowDownFactor = 0.05f;
    public float slowDownDuration = 2f;
    void Update() {
    Time.timeScale += (1f / slowDownDuration) * Time.unscaledDeltaTime;
    Time.fixedDeltaTime += (0.01f / slowDownDuration) * Time.unscaledDeltaTime;
    Time.timeScale = Mathf.Clamp(Time.timeScale, 0f, 1f);
    Time.fixedDeltaTime = Mathf.Clamp(Time.fixedDeltaTime, 0f, 0.01f);
    }
    public void DoSlowMotion() {
    Time.timeScale = slowDownFactor;
    Time.fixedDeltaTime = Time.fixedDeltaTime * slowDownFactor;
    }
    }

    • @Silver4Hire
      @Silver4Hire 4 ปีที่แล้ว +1

      u saved me! can you explain to me code by code tho, don't quite understand

    • @infinityplays2296
      @infinityplays2296 4 ปีที่แล้ว +1

      @@Silver4Hire I'm sorry, havent been coding anymore for quite some time, I don't really understand it myself anymore ':). It slows the physics-forces down, simultaneously to the time.

    • @Silver4Hire
      @Silver4Hire 4 ปีที่แล้ว

      @@infinityplays2296 ok, ty!

    • @goodgamershow6505
      @goodgamershow6505 3 ปีที่แล้ว +3

      @@Silver4Hire Basically his code is similar to Brackeys', but in the video Brackeys for some reason didn't change back the Time.fixedDeltaTime. Because of this, the fixedDeltaTime variable, which controls in-game physics, was working incorrectly, leading to some physics-related issues in the game(like Rigidbody and etc). So Infinityplays brought back the initial value of Time.fixedDeltaTime in Update function(there're better ways to set the value of Time.fixedDeltaTime back to normal and you can find them in the comments)

    • @denghaoliu5709
      @denghaoliu5709 2 ปีที่แล้ว

      Thanks for saving me. It also fixs the dropping FPS after change the time scale;

  • @eeveelution8035
    @eeveelution8035 7 ปีที่แล้ว +121

    You shouldn't change the fixedTimeScale to make smoother rigidbody movements. Just enable the interpolate option for the rigidbody.

    • @LynxSASW
      @LynxSASW 5 ปีที่แล้ว +5

      Underrated comment, literally saved me, thanks

    • @piroxhexule5587
      @piroxhexule5587 5 ปีที่แล้ว +2

      Thank You Very much, this comment got me out of a tight spot.....

    • @FriMeDev
      @FriMeDev 5 ปีที่แล้ว +8

      I'm not sure about this. Unity recommends to use interpolation only for objects followed by a camera, because you could see some jittering in this case. Maybe it might be better to adjust the fixedTimeScale only for the duration of the slowmotion than to activate interpolation for every object in the scene. Espacially if you have a lot of rigidbodys. But that's just my theory. Couldn't find anything about the performance of a rigidbody with activated interpolation.

    • @RobertoGattoArt
      @RobertoGattoArt 5 ปีที่แล้ว +1

      Came to say the same thing, this needs more upvotes

    • @venomtailOG
      @venomtailOG 5 ปีที่แล้ว +3

      Good thing he didn't mention it. It breaks everything

  • @micmacha
    @micmacha 2 ปีที่แล้ว +1

    You have a natural talent for tutorials.

  • @JimGiant
    @JimGiant 8 ปีที่แล้ว +26

    FixedUpdate and fixedDeltaTime finally make sense! Thanks bro.

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +5

      Haha I'm glad to hear that :)

  • @NielsvanAmstel
    @NielsvanAmstel 8 ปีที่แล้ว +3

    I have to say, this is a great tutorial. It's very concise and I understood everything from start to end. Keep up the good work!

  • @tassodemo2316
    @tassodemo2316 4 ปีที่แล้ว +1

    This man literally makes every tutorial I need.

  • @atmunn1
    @atmunn1 7 ปีที่แล้ว

    I love the idea of pay-what-you-want. It lets people who just want to get the stuff (or can't pay for it) get it without worry, but lets people that really like the creator and want to support them do it as well. Obviously, it doesn't work for everything, but I think it works really well for things like music and assets.

  • @markhermens1174
    @markhermens1174 7 ปีที่แล้ว +1

    True Unity MVP.
    Thanks for all these tutorials

  • @SuperRalle123
    @SuperRalle123 8 ปีที่แล้ว

    These videos are great! It is so much more entertaining to learn these special things you can do instead of 25 hours of tutorial. Keep it up!

  • @zokerino447
    @zokerino447 5 ปีที่แล้ว +53

    Me:omg this must hard to do this.
    Brackeys:*writes 2 lines of code*
    Me:thousands years of academy training wasted!

  • @leshaseletskiy7755
    @leshaseletskiy7755 7 ปีที่แล้ว +2

    Love this tutorial i almost never find good unitys tutorials but this is amazing!

  • @fidyculous
    @fidyculous 4 ปีที่แล้ว +5

    for a smooth transition from slow time back to normal you have to put the following line in the update Method: Time.fixedDeltaTime = Time.timeScale * .02f;
    or else your fixed delta time will stay slow after hitting bullet time once

    • @dasquid7216
      @dasquid7216 3 ปีที่แล้ว

      Thanks you fixed my problem!

    • @lamngo9108
      @lamngo9108 ปีที่แล้ว

      Thanks so much bro

  • @JoshuaReyes
    @JoshuaReyes 8 ปีที่แล้ว +3

    This is a great tutorial, as always you explain everything brilliantly. Keep up the great work.

  • @matheusmachado5038
    @matheusmachado5038 8 ปีที่แล้ว

    Your tutorials keep getting better! I wish you get more support!

  • @Ali107
    @Ali107 7 ปีที่แล้ว +265

    *SUPER*
    *HOT*

    • @syrenate7001
      @syrenate7001 6 ปีที่แล้ว +5

      I was just waiting for someone to say that and they finally did.

    • @mihirkamat504
      @mihirkamat504 6 ปีที่แล้ว +12

      Ali_Army107 The most innovative shooter I've played in years.

    • @yiz2675
      @yiz2675 6 ปีที่แล้ว +3

      *SUPER*
      *HOT*

    • @clarkkent1473
      @clarkkent1473 6 ปีที่แล้ว

      XD

    • @limageur
      @limageur 5 ปีที่แล้ว +2

      SUPER
      HOT

  • @VisserStudio
    @VisserStudio 5 ปีที่แล้ว +1

    I tried combining this slow down time with another object pooler tutorial and that just made all the cubes go wild.

  • @TheGamingzombie1
    @TheGamingzombie1 8 ปีที่แล้ว +6

    Your videos are so great! I'm so glad I found this channel!!

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +4

      Thansk! :)

  • @manofqwerty
    @manofqwerty 7 ปีที่แล้ว +1

    I'm just starting out and this video helped me a lot even though I am not implementing a snow motion feature! Thanks

  • @julietmikealpha
    @julietmikealpha 8 ปีที่แล้ว

    ...and of course, I made an earlier comment about some things in the video when the answer is to download the project and have a look :). Really great content, thank you!

  • @m_rizaal
    @m_rizaal 3 ปีที่แล้ว +2

    Notice that he used comments to show how he made that bombing script
    A living legend

  • @alaslipknot
    @alaslipknot 8 ปีที่แล้ว +33

    Ok so this is a good fun way to do slowmotion for beginners, and thanks for that.
    But, i *highly* recommend to avoid it, and here is why, there is going to be SO MANY case where you'll need to use the normal timeScale (1.0) but since its slowed down then you'll run into problem, a recent example that i had, is when i slowed the game using this method, but then wanted to use iTween to do a normal camera shake but then iTween used the slowed time which gave me the wrong effect, another time is when i had the slow on but i also had a UI animation that needed to play, and again, that animation played slowly.
    So for this, i highly recommend that you create a public static timeScale float, and any time you used Time.deltaTime you also multiplied by your static timeScale variable, and you use that variable to control the speed of the objects that you want them to slow down and keep the other objects intact.
    For physics is a whole different issue, that i personally didn't run to because i rarely use physics in my game.
    cheers

    • @bairgamingdev1576
      @bairgamingdev1576 4 ปีที่แล้ว +4

      can you explain in a little more depth how this could be done?

  • @amyshaw893
    @amyshaw893 7 ปีที่แล้ว +1

    This whole thing would have. been very useful for a project I did a little over two years ago. So much so, I think I'll completely remake that project tomorrow. Some of it anyway

  • @MaxxKatarn
    @MaxxKatarn 5 ปีที่แล้ว +1

    Thanks for that short but effective tutorial !

  • @josephwagner9496
    @josephwagner9496 6 ปีที่แล้ว +9

    Well, this seems more promising than just wrapping my update in an integer counter thing.

  • @TechXSoftware
    @TechXSoftware 8 ปีที่แล้ว +2

    Good vid, didn't know it would be this easy, I was thinking, every component needed to slow down manually.

  • @waterfallw
    @waterfallw 8 ปีที่แล้ว +1

    detailed yet to the point. Thanks, keep up the good work!

  • @Archetapp
    @Archetapp 8 ปีที่แล้ว +11

    Loved this tutorial! Thanks man, you da best! 🔥

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +6

      Glad you liked it! You're welcome ;)

  • @Tschudenizer
    @Tschudenizer 7 ปีที่แล้ว +1

    What was my first thought as I saw the red cubes and the white background: Super Hot :-)
    Again a very good and informative video, good work, keep it up!

  • @littleowlgaming-unity-tutorial
    @littleowlgaming-unity-tutorial 2 ปีที่แล้ว

    ive been watching brackeys vids for years. and it JUST dawned on me. Brackeys.... the logo is brackets. their... brackies!! omg.

  • @antonysze
    @antonysze 7 ปีที่แล้ว +37

    10:09 Should update the fixedDeltaTime when recovering the timeScale to normal?

    • @PauloHenrique-jr7ir
      @PauloHenrique-jr7ir 5 ปีที่แล้ว +20

      Yep... If you are working with Physics that's mandatory:
      void Update() {
      Time.timeScale += (1.0f / slowDownLength) * Time.unscaledDeltaTime;
      Time.timeScale = Mathf.Clamp(Time.timeScale, 0f, 1f);
      if (Time.timeScale == 1.0f) {
      Time.fixedDeltaTime = Time.deltaTime;
      }
      }

    • @ASSSGROUP
      @ASSSGROUP 4 ปีที่แล้ว +3

      @@PauloHenrique-jr7ir Thanks man !!!

    • @tudorradu5848
      @tudorradu5848 4 ปีที่แล้ว +1

      @@PauloHenrique-jr7ir THANK YOU SOO MUCH! My time scale stayed in slow mo and I couldn't figure out how to go back to normal

  • @MaeveFirstborn
    @MaeveFirstborn 8 ปีที่แล้ว +1

    Again, congrats on 200,000!

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว

      Thanks man!

    • @MaeveFirstborn
      @MaeveFirstborn 8 ปีที่แล้ว

      Brackeys Your welcome! Been a fan since 120K I think, around the time you started the 2D tutorial in Unity. Weren't for you, wouldn't know half what I do about this engine or C# in general.

  • @Batataglins
    @Batataglins 4 ปีที่แล้ว +24

    This slowmo affects everything in the game and I had an issue in animated UI elements.
    I asked help for a senior programmer, and his said.
    "You can use Time.unscaledDeltaTime instead Time.deltaTime where you don't want to be affected by Time.timeScale.
    Animator has an option at his inspector "Update Mode", set it to "Unscaled time". "
    Eg.:
    private IEnumerator WaitForSeconds()
    {
    var time = 0f;
    while(time < _secondsToWaitToActivateNextButton)
    {
    time += Time.unscaledDeltaTime; // instead Time.deltaTime
    yield return null;
    }
    }

    • @beepboop5684
      @beepboop5684 3 ปีที่แล้ว +2

      I know this is a 1 year old comment but tysm

  • @ognjenpingvin
    @ognjenpingvin 8 ปีที่แล้ว +2

    This quick tutorial thing is really nice!

  • @TheBlueJJayTBJJ
    @TheBlueJJayTBJJ 8 ปีที่แล้ว +41

    I'm waiting on him to make a game hit that goes big

    • @magnusm4
      @magnusm4 7 ปีที่แล้ว +1

      I'm instead gonna learn from him and many others to make my own game not restricted by common things. I want an fps with real creativity i'm talking Deviant Art levels of creative designs and such. and one is an fps but NO FUCKING ASSAULT RIFLES and nothing automatic besides a slow machine gun

    • @AArrad
      @AArrad 7 ปีที่แล้ว +10

      magnusm4 how's the game going?

    • @dragonslayer4922
      @dragonslayer4922 4 ปีที่แล้ว

      @@magnusm4 its been two years bro how's it goin for ya

    • @Maclennon
      @Maclennon 4 ปีที่แล้ว +2

      @@magnusm4 I don't get your hate towards assault rifles in games, I know they are a bit overplayed but that's not the guns fault, that is the fault of developers who can't think of a way to make them more fun.
      the secret is to make them unreasonably powerful, like artillery canon powerful. I want my M16 to blow a whole the size of a car and kick me 10 feet back, doesn't that sound fun?

    • @monkeyrobotsinc.9875
      @monkeyrobotsinc.9875 4 ปีที่แล้ว

      @@magnusm4 lol what kind of shitty common game has guns in it

  • @deezdev9540
    @deezdev9540 3 ปีที่แล้ว

    when you run out of brackeys tutorials: WHY AM I ALIVE! JUST TO SUFFER

  • @MEGA_TREE
    @MEGA_TREE 3 ปีที่แล้ว

    Slow motion is the best cinematic option ever made

  • @vastjigglypuff6811
    @vastjigglypuff6811 4 ปีที่แล้ว +2

    Time.deltaTime is one of the most said things in this channel

  • @shawna9807
    @shawna9807 8 ปีที่แล้ว +1

    I actually created a game kinda just like this after this tutorial, very helpful 9.999/10

  • @yanalcantara4294
    @yanalcantara4294 7 ปีที่แล้ว +151

    >sets Time.timescale to 0
    >hit the play button
    >Scream ZA WARUDO
    >????
    >Profit

    • @hunterfox6176
      @hunterfox6176 6 ปีที่แล้ว +3

      Literally did that today

    • @kaandoesstuff3402
      @kaandoesstuff3402 5 ปีที่แล้ว +5

      @YASTRON Then you are gonna piss off the weird looking church guy who has a crush on dio

    • @Altives
      @Altives 4 ปีที่แล้ว +1

      Yan Alcântara but the SLOW time thing slows u too

    • @shazboi
      @shazboi 4 ปีที่แล้ว +1

      U wanna shoot random spawning doods while synthwave music controls your movement? Then play this (its got kewl slomo and some jojo references)
      itch.io/jam/gmtk-2020/rate/697356

    • @ElijahMorganChannel
      @ElijahMorganChannel 4 ปีที่แล้ว

      @@DaveElJefe yes

  • @unscriptedlogicgames
    @unscriptedlogicgames 4 ปีที่แล้ว +5

    I expected a "Thanks for tuning in at Brackeys" in the intro.

  • @goodgamershow6505
    @goodgamershow6505 3 ปีที่แล้ว +2

    If you have a pause menu, which uses timeScale, the script in Update functions shown in this video can interfere and keep the game running. To fix this simply add a bool variable, that represents if the game is paused or not, and then use the code below:
    public PauseMenu pauseRef; //drag and drop your pause script here
    void Update(){
    if(pauseRef.GameIsPaused == false){
    Time.timeScale += 1f / slowdownLength * Time.unscaledDeltaTime;
    Time.timeScale = Mathf.Clamp(Time.timeScale, 0f, 1f);
    }
    }

  • @I2EF
    @I2EF 5 ปีที่แล้ว +1

    For anyone having the same issue as me, where for some reason frames would massively drop after activating the slow motion do this:
    if (timeBulletFactor < 1)
    timeBulletFactor += (1 / timeBulletLenght) * Time.unscaledDeltaTime;
    Time.timeScale = timeBulletFactor;
    Time.timeScale = Mathf.Clamp(Time.timeScale, 0f, 1f);
    public void BulletTime(float factor, float lenght)
    {
    timeBulletLenght = lenght;
    timeBulletFactor = factor;
    Time.fixedDeltaTime = Time.timeScale * 0.02f;
    }

  • @redfireanimation5202
    @redfireanimation5202 2 ปีที่แล้ว

    Thanks for the tutorial! This was exactly what I needed for my project.

  • @OneMoreWanderer
    @OneMoreWanderer ปีที่แล้ว +1

    @Brackeys, my objects aren't speeding back up, but the player is. how can I fix this?

  • @HAWXLEADER
    @HAWXLEADER 7 ปีที่แล้ว +1

    Unscaled delta time was a nice thing to learn^^
    However i use interpolation instead of increasing simulation fidelity.

  • @amitchameides
    @amitchameides 8 ปีที่แล้ว

    That was awesome - simple and really useful! Thank you!

  • @khushalkhan83
    @khushalkhan83 5 ปีที่แล้ว +2

    You have changed the fixedDeltaTime too, i think you should reset that value in Update function too

  • @MalbersAnimations
    @MalbersAnimations 8 ปีที่แล้ว

    Amazing as always!!!! please make one about events, delegates and message systems

  • @DavidPatMathis81
    @DavidPatMathis81 4 ปีที่แล้ว

    Great snappy video!

  • @AnilSardiwal
    @AnilSardiwal 8 ปีที่แล้ว +2

    Thank you for this awesome tutorial.

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +1

      You're welcome :D

  • @cryomen
    @cryomen 7 ปีที่แล้ว +27

    Hi Brackeys. There is no need to hack "Time.fixedDeltaTime". Instead select "Interpolate" in Rigidbody.
    ====================
    Good to mention. In your case changing "Time.fixedDeltaTime" will lead to inaccurate physics calculation, as long as internaly engine sees increase Physics frame rate.
    Why "inaccurate": physics engine is not perfect and results will always be different with different "Physics frame rate" values.
    ====================
    For quick test DO:
    1. Remove Line #17 in TimeManager.cs (t.e. Time.fixedDeltaTime = Time.timeScale * .02f;)
    2. Every Cube's rigidbody should have "Interpolate" field set to "Interpolate"

    • @gaudamthiyagarajan5705
      @gaudamthiyagarajan5705 7 ปีที่แล้ว +2

      my boxes lost force on setting fixedDeltaTime your solution works like a charm. Thanks mate

    • @gaudamthiyagarajan5705
      @gaudamthiyagarajan5705 7 ปีที่แล้ว +1

      my boxes lost force on setting fixedDeltaTime your solution works like a charm. Thanks mate

    • @alexandrelucas808
      @alexandrelucas808 7 ปีที่แล้ว +1

      You're my new god dude, i've been looking for a solution for hours, and i just had to check that to unbug all my mechanic, dude i love you so much

    • @Sparrow420
      @Sparrow420 6 ปีที่แล้ว +4

      another pro tip:
      If you don't want to set interpolate on(for performance reasons or what not),
      use the post processing stack's motion blur effect with frame bending.
      it get rids of the jitter unless you have object fly at extreme speed, in that case they are probably on interpolate for another reason.
      it does an absolutely amazing job as a slow motion effect of it's own, helping to indicate you're in slow motion( i find it hard to tell at some environments )

    • @prabhatpankaj8719
      @prabhatpankaj8719 4 ปีที่แล้ว +1

      😭😭😭 thanks a lot it fixed my game

  • @hosseinarabbeigi8377
    @hosseinarabbeigi8377 5 ปีที่แล้ว +1

    Amazing tutorial! thanks!

  • @Lazzarus7
    @Lazzarus7 8 ปีที่แล้ว +1

    very cool tutorial, thanks!

  • @exp3l3r22
    @exp3l3r22 8 ปีที่แล้ว +8

    I just love how jolly you look.. ALL THE TIME xD

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +6

      Thanks a lot! :) Making tutorials is fun, hard not to look jolly ;)

    • @exp3l3r22
      @exp3l3r22 8 ปีที่แล้ว +1

      np, keep up the amazing work :)

  • @JohnDoe-fv5cu
    @JohnDoe-fv5cu 7 ปีที่แล้ว +1

    Really useful! Thank you very much!

  • @artinmajidi1654
    @artinmajidi1654 4 ปีที่แล้ว

    I had NO CLUE this was so easy....

  • @AndromAK666
    @AndromAK666 8 ปีที่แล้ว +5

    very thank you for your work!

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +3

      You're welcome :D

  • @chillerdude1
    @chillerdude1 4 ปีที่แล้ว +1

    If you implement it to your game and in your game there's a function where you pause the game, the time.timeScale will automatically raise to 1 again. you have to make a parameter lets say Bool isRaising and give it a false value, and when the slow motion function is being called give it a true value and when the slowmotion finished do isRaising false

  • @fisslewine1222
    @fisslewine1222 7 ปีที่แล้ว +1

    Brilliantly ant tutorials! And will check out Doug models!

  • @marquesghm
    @marquesghm 7 ปีที่แล้ว +1

    Just Beautiful!

  • @alialhamwi7224
    @alialhamwi7224 6 ปีที่แล้ว +1

    Very useful I loved it :D

  • @hexagonofficial7298
    @hexagonofficial7298 7 ปีที่แล้ว

    Brackeys, you are amazing

  • @spoodytheone6799
    @spoodytheone6799 7 ปีที่แล้ว

    If you set the timescale to the movement speed you can essentialy create super hot

  • @user-ls7dl7ss6f
    @user-ls7dl7ss6f 4 ปีที่แล้ว +7

    When I enable slow motion it effects looking around too. How do I fix it so it doesnt effect my mouse?

    • @user-ls7dl7ss6f
      @user-ls7dl7ss6f 4 ปีที่แล้ว

      @@DiscoLizzard I did manage to fix it. Make sure your mouse movement isnt multiplied by time.deltatime. I removed that and it fixed my issue.

    • @pythonhtmljava7811
      @pythonhtmljava7811 4 ปีที่แล้ว +1

      @@user-ls7dl7ss6f Well, you didn't really fix it. Now worse computers will have slower mouse movement because their fps will be low.
      İf you want a real fix, multiply it with Time.unscaledDeltatime , so it wont be effected by Time.timescale but it will still fix issues with slower computers. Doing that will also probably require you to increase mouse turn speed because Time.unscaledDeltatime is probably really small value.

  • @chrisjogos
    @chrisjogos 8 ปีที่แล้ว

    awesome tutorial

  • @user-qw7hb4du6z
    @user-qw7hb4du6z 7 ปีที่แล้ว

    OMG ur video helped the devs of superhot

  • @MohammedAlqiFahrezi
    @MohammedAlqiFahrezi 8 ปีที่แล้ว +12

    brackeys please upload "How to make a cutscene on Unity"

    • @monkeyrobotsinc.9875
      @monkeyrobotsinc.9875 4 ปีที่แล้ว +2

      and then "how to make a great game with no effort on unity" after that.

  • @SpyderGamer
    @SpyderGamer 3 ปีที่แล้ว +1

    Can this be triggered by collisions? Like a collision that is similar to the one for post prcessing

  • @zentergames1622
    @zentergames1622 5 ปีที่แล้ว

    You share a important information, good

  • @SinanAkkoyun
    @SinanAkkoyun 8 ปีที่แล้ว +7

    Uhm the Explosion you intantiated, does it multiply the force by Time.fixedDeltaTime or something? Because my explosion has far less power in slowmotion as in normal motion...

    • @fidyculous
      @fidyculous 4 ปีที่แล้ว +2

      when you apply forces you have to divide by Time.timeScale or else your forces will be weaker since most of them depend on fixedDeltaTime

  • @waelalenezi5687
    @waelalenezi5687 5 ปีที่แล้ว +2

    Thank you for the tutorial. I was wondering If it possible to increase the timescale beyond 100?

  • @spl45hz
    @spl45hz 8 ปีที่แล้ว +1

    You really should Update fixed DeltaTime to normal aswell, because now you get 50 times more physic calculation which will slow down your framerate, especially if you have use a lot physic in your game

  • @xavierlanglands9486
    @xavierlanglands9486 4 ปีที่แล้ว +1

    For anyone running into this issue, I am using the latest version of Unity and when I ran the code my entire game would freeze (movement wise) then snap back to normal speed. Turns out that for me, I had to use "Time.fixedDeltaTime = Time.timeScale / 50;" instead of "Time.fixedDeltaTime = Time.timeScale / 0.02f;".

  • @jeffreycrane8298
    @jeffreycrane8298 8 ปีที่แล้ว +1

    Thank's for this topic!
    Question - in the time manager update function, why not wrap the time.timescale adjustment inside an If( time.timescale < 1) and avoid increasing it only to decrease it with the math.clamp() function?
    Is one way or the other better performance?
    Enjoying your video's... Keep up the great work!

  • @AsitorCorporation
    @AsitorCorporation 6 ปีที่แล้ว +2

    For me, the slow motion wouldn't end - the update method never seemed to run. I just made a function that ran :
    Time.timeScale = 1f;
    Time.fixedDeltaTime = 0.01f;
    That made the time go back to the same settings I had before it started. I can't work out why the code you did failed for me, but I wanted it to go straight back rather than fade anyway so it worked out this way.

    • @dbcomix
      @dbcomix 5 ปีที่แล้ว +1

      Thank you! This is just what I needed to reset my time to its defaults.

  • @Lucas-lv4zm
    @Lucas-lv4zm 8 ปีที่แล้ว +7

    Mmm beutiful work you danish genius

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +4

      Haha thanks man ;)

    • @tiopeperino9501
      @tiopeperino9501 7 ปีที่แล้ว

      that explains why he makes videos on "wed-nes-days" instead of "wensdays" jajajaa

  • @lindal93
    @lindal93 6 ปีที่แล้ว +3

    Hi! Used your lesson, thank you very much!
    But there is one problem-the weapon throws out shells normally, but after one application of effect of SLOW MO of a shells cease to be thrown out normally and just fall under feet to the character as if they had sharply increased weight. Please help

    • @gatorjac
      @gatorjac 5 ปีที่แล้ว

      Hello, I am currently experiencing the same issue. Any luck? Thanks

  • @Queue3612
    @Queue3612 7 ปีที่แล้ว

    holy fucking shit, i now know what public and private are in C#, Thanks man

  • @coyoty5191
    @coyoty5191 5 ปีที่แล้ว

    if you are having a problem with Time.fixedDeltaTime = Time.timeScale * 0.02f;
    put this in Update Time.fixedDeltaTime = (Time.timeScale * .02f);
    it fixed my problems

  • @haophanphu3169
    @haophanphu3169 7 ปีที่แล้ว

    nice tutorial, thank you

  • @camy_dev
    @camy_dev 6 ปีที่แล้ว

    Thank you man so awesome

  • @macksowo
    @macksowo 4 ปีที่แล้ว +2

    Would there be any way to move freely in slowed down time? For my game I’m trying to make a way to slow down / stop time and let the player move around freely whilst everything else is frozen.

  • @blind_neighbourhoodNerd
    @blind_neighbourhoodNerd 6 ปีที่แล้ว

    Thanks so much!!

  • @mahdimahdavi663
    @mahdimahdavi663 8 ปีที่แล้ว +1

    Hey Brackeys thanks for this tutorial that was very useful so I have a questionWhat is your next tutorial course?Can you

  • @VoidloniXaarii
    @VoidloniXaarii 5 ปีที่แล้ว

    Awesome. Thank you

  • @tomasmichek5842
    @tomasmichek5842 4 ปีที่แล้ว +1

    Hi, I'm a bit new to this, so sorry if this question is stupid. When I try to type in the "Time" in Time.timeScale only piece of line that apears is "GetFinalTime". Is it possible that I'm missing a command library? If so, where could I find and download the one required to finish this tutorial?

  • @GucioDevs
    @GucioDevs 8 ปีที่แล้ว +11

    Hey, is there any performance benefits from removing the "using" tags? (@ 1:22)
    Tak mand ;)

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +17

      Nope not at all, the compiler will surely see that nothing is used from those namespaces and remove them - it's just a lot cleaner without :D

    • @GucioDevs
      @GucioDevs 8 ปีที่แล้ว

      Brackeys alright thanks!

    • @davidenale17
      @davidenale17 8 ปีที่แล้ว +8

      Brackeys I have an idea for a new tutorial that can help a lot of people( since there's no tutorials on the internet): how to make a modular building system (with blocks/slopes. what do you think about this?

    • @Brackeys
      @Brackeys  8 ปีที่แล้ว +21

      Hi there, good idea! I'll definitely consider it :)

  • @amrmoataz3860
    @amrmoataz3860 7 ปีที่แล้ว +1

    This is really Helping. i really appreciate your work
    but i have a question.. is there a way to use like a locale timeScale?... like if i want to change the time scale for some objects without effect the time scale of others

  • @Kopikyatto
    @Kopikyatto 4 ปีที่แล้ว +1

    Great tutorial, one question though where im not really able to find the answer for anywhere:
    How can I slow down time except slow down the player?
    for example in your project when you shoot the boxes time gets slowed down but so does the player, is there a way to shoot the boxes, slow down time, but have the player move at the normal speed?

    • @ranchonbread4905
      @ranchonbread4905 4 ปีที่แล้ว

      Ok, this is a very sloppy solution, but i just made it so when my player is slowed down, his speed increases by however much the game slowed down. IE (game that is slowed down by 50%, make player 50% faster)

  • @jahanzaibminiclick3676
    @jahanzaibminiclick3676 7 ปีที่แล้ว

    nice brother i like ur tuts

  • @texaco3254
    @texaco3254 4 ปีที่แล้ว +1

    Assets/Tir.cs(31,22): error CS1061: 'TimeManager' does not contain a definition for 'DoSlowmotion' and no accessible extension method 'DoSlowmotion' accepting a first argument of type 'TimeManager' could be found (are you missing a using directive or an assembly reference?)

  • @BerrisGaming
    @BerrisGaming 4 ปีที่แล้ว +6

    When he said hierarchy I thought he said "horror key"

  • @Trifox_anims
    @Trifox_anims 4 ปีที่แล้ว +1

    i think that this code should do the same no
    public float slowdownfactor = 0.05;
    public slowmotion ()
    {
    if(Input.GetKey(KeyCode.E))
    {
    Time.timeScale=slowdownfactor;
    Invoke(exitslowmotion,1f);
    }
    }
    public exitslowmotion()
    {
    Time.timeScale=1;
    }

  • @tahiriqbal8543
    @tahiriqbal8543 7 ปีที่แล้ว

    nice work

  • @amundherfindal6577
    @amundherfindal6577 3 ปีที่แล้ว +2

    How do you make some objects slow down, while some stay the same?