Adding Hit Stop to Your Game

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024

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

  • @Barbleder
    @Barbleder 7 месяцев назад +1

    This is what I’ve needed for the past 2 hours, thanks!

  • @veltarden2419
    @veltarden2419 2 года назад +10

    Pretty clear video! One of the hit stops that I really like is when you do a parry in Ultrakill, that little stop letting you see and sorta feel the punch is great

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

    Simple,fast, Informative, well spoken and pretty helpful overall tutorial, thank you very much sir!

  • @zacharyrenfro3716
    @zacharyrenfro3716 2 года назад +1

    As someone who has never even heard of Coroutines, I was able to follow along and pretend like I understood what was happening. I'm sure as I do it more I'll get more familiar with the logic behind everything, but nevertheless, this was an amazing tutorial that was easy to follow and impliment into my own game. Tysm!

  • @pritheebecareful6895
    @pritheebecareful6895 5 лет назад +11

    I really like the hit stop in smash bros. Just the right amount for that game.

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

    Simple clean and fast. THank you for sharing the source code as well!

  • @reversible8740
    @reversible8740 4 года назад +2

    I imagine there is a reason, but your code videoa are incredible, I would love to see you continue.

  • @libiroli
    @libiroli 2 года назад +4

    FYI: If you destroy the object that calls the pause (ie: a dying unit start a coroutine to pause the game) timescale won't return to normal after that object is destroyed. So only call this from objects which persist.

    • @Lumix_Corrupt
      @Lumix_Corrupt 2 года назад +1

      Or just set the timescale back to 1.0x right before the Destroy statement

    • @egeyaman4074
      @egeyaman4074 Год назад +1

      best solution is, keep pauser object in hierarchy seperate, undestroyable and call it when you need, not in enemy object

  • @trashcaster
    @trashcaster 2 года назад +11

    Just for anyone implementing this, it's better practice to create a singleton/static instance for your manager classes, rather than calling FindObjectOfType. Having static references will have less overhead than getting the Unity engine to scan through objects to check their types, and will significantly increase performance in areas where you try to access said objects frequently.

    • @adamh3945
      @adamh3945 11 месяцев назад

      Came looking for this comment!

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

    Thank you for the vid. High quality content, I think your channel is gonna blow up soon.

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

      Thank you!
      I hope it does aha sharing the video helps with that!

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

    That is good , it might be applied to fighting game with this tip

  • @sinthebay
    @sinthebay 4 года назад +2

    imagine finding an amazing channel and than finding out it's inactive

    • @NebulaCoding
      @NebulaCoding  4 года назад +2

      College is tough 🙃
      I really like making these though! Possibly more in the future

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

      YOURE IN COLLEGE!? This content is way too good man props to you for squeezing all of this into ur schedule

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

    Love every your unity related video, but I see your latest video is 2 years ago. I hope you can active post tutorial again.

  • @_ZEG
    @_ZEG 5 лет назад +2

    Interesting stuff! Thanks!

  • @ukidabek
    @ukidabek 5 лет назад +1

    You can make hit stop coroutine public and inside WaitForSpawn do yield return HitStopCoroutine(.1f). When you do this WaitSorSpawn coroutine will wait untile the HitStopCoroutine end it execution. In my opinion It's more readable that way.

    • @NebulaCoding
      @NebulaCoding  5 лет назад +2

      That's one way to do it. I hadn't actually considered doing it this way so it's cool to see a different take. Which one is more readable is definitely up to interpretation. In this example the crate is destroyed in one shot, but in a real use-case enemies would often take more than one hit, and you would still need to initiate hit-stop then. This is also designed to make it so that you can initiate hit-stop from anywhere and not really have to worry about it. The WaitForSpawn bit was included more to show the kinds of things you want to take into consideration when implementing hit-stop.
      You definitely know what you're doing, so whatever works best for your game is the right way to go :)

  • @ULTRADARKSETH
    @ULTRADARKSETH 5 лет назад +2

    @sixdot. How about a video on effects like the trail and smoke effect like in the start of this video. Would be awesome!!!

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

    hit stop is best used in some sort of melee combat. for example fighting games in general have it and without it, they would feel very awkward.

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

    Great video, thanks

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

    Why didn't you use "Invoke" ?? Less code , safe effectiveness

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

    Using FindGameObjectWithType isn't a good idea - its probably best to use a singleton for the hitstop

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

    As I am using timeScale also for pausing I have run into an issue where pausing right after hitting an enemy ends up in a really bad scenario (game is paused but player can move).
    Any ideas how to go around it?

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

      My solution is generally to create something that automatically manages this for me. It could be as simple as having the hit stop coroutine check a static *paused* bool from another object, or as complex as having a class just to manage how other classes can access time scale (if you have a lot of time stopping and slow motion effects).
      Someone else in these comments mentioned using animations instead of time scale to creat a similar effect in multiplayer (where time-scale changes are ill-advised) so that might work, but it's more of a work around at that point.

    • @gamongames
      @gamongames 4 года назад +2

      A simple check if(paused && timeScale != pausedTimeScale) {timeScale = pausedTimeScale} on update will solve that and will run only once.

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

    will this work in 3d as well?

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

    Great video

  • @三页-g4o
    @三页-g4o 4 года назад

    i dont think is a good idea, Time scale is a global variable,its can‘t be use in Multiplayer game,like monster hunter world

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

      Yes, this approach is not recommended for multiplayer games. You generally should not manipulate time scale in multiplayer games. Just like how a start menu shouldn't pause the game in multiplayer but normally does in single player.
      I can't think of any multiplayer games that use hit stop (maybe Monster Hunter does? I haven't played it).

    • @三页-g4o
      @三页-g4o 4 года назад +1

      ​@@NebulaCoding i think may be use
      animator.speed = 0;
      rigibody.bodyType = RigidbodyType.Static;
      can achieve that

    • @SlCKNESS_
      @SlCKNESS_ 2 года назад +2

      @@NebulaCoding Pretty sure most fighting games have hitstop.