How to Make a Camera System (Like Hollow Knight's) in Unity using Cinemachine | 2D Tutorial

Поділитися
Вставка
  • Опубліковано 22 лис 2024

КОМЕНТАРІ •

  • @sasquatchbgames
    @sasquatchbgames  Рік тому +28

    be sure to add #if UNITY_EDITOR before the MyScriptEditor script, and an #endif at the end of it, or this will give you errors when you try to build the game.

    • @fireraccoon_
      @fireraccoon_ Рік тому +1

      i used this but when i try to build game i have " cannot build game while player is compiling and building script" any idea?:(

    • @fireraccoon_
      @fireraccoon_ Рік тому +3

      fount issue....you must put this #If Unity_EDITOR before "[CustomEditor(typeof(CameraControlTrigger))]" not in the middle of this and MyScriptEditor :)

    • @DawidLewandowski-ev7rd
      @DawidLewandowski-ev7rd Рік тому +2

      oh god , thx bro i find this comment like sec before i got rage at my code and trow my laptop out the window

  • @actuallyZiggyZagga
    @actuallyZiggyZagga Рік тому +27

    Wow! As an spiring Game Designer, I never realized how nuanced the camera system is in Hollow Knight, Devs should certainly implement this system in their games. Thank you Sasquatch B Studios, for another amazing tutorial!

  • @Watzefuk1192
    @Watzefuk1192 Рік тому +13

    The breakdown of how it works in hollow knight is a life saver man thanks. Was planning on doing that at some point to fine tune my camera system!

  • @MrBb155
    @MrBb155 9 місяців тому +2

    Honestly, your tutorials have saved my skin enormously! excellent explanations and actually teaches the functionalities in unity and not just a copy me code.

  • @CogNoman
    @CogNoman Рік тому +5

    Great video. I never even thought of or noticed any of this while I was playing. If you had asked me, I would have just assumed the camera always kept the knight in the centre of the screen.
    It's very interesting because, in my head, I kind of figured "I could make a game like Hollow Knight" (because I can draw cartoons and use Unity) - but this video shows that there's quite a lot of polish and subtlety in a lot of aspects of the game - there's a reason why Hollow Knight was a success while most other 2D cartoon platformers fade in to obscurity.

  • @pdstudio4477
    @pdstudio4477 Рік тому +2

    Note that "Oversize Window" is available on Cinemachine +2.7.5 We installed Cinemachine from the package manager and Unity installed version 2.6 which make us a little lost for a while but just update and that'll do the trick. Excellent system as this is not a camera system is THE Camera System... THANKS A LOT!!!!

  • @midniteoilsoftware
    @midniteoilsoftware Рік тому +6

    I love tweening libraries. I personally like DOTween but LeanTwean looks like a fantastic option.

  • @MI-ll3xy
    @MI-ll3xy 11 місяців тому +3

    This is the best ever camera tutorial on YT and helped a lot! Thank you.

  • @cheesymcnuggets
    @cheesymcnuggets Рік тому +7

    This is something ive never really thought about, very interesting. I wonder if there are any camera tricks i could use in a 2d top-down game

    • @sasquatchbgames
      @sasquatchbgames  Рік тому +2

      guess that depends, is there shooting in your game for example? If so, slightly biasing the camera towards the mouse direction is a nice touch (like what Enter the Gungeon does)

  • @heroslegendstudios1658
    @heroslegendstudios1658 Рік тому +3

    Great stuff can't wait to bring this kind of camera work into my game

  • @TheWunshot
    @TheWunshot Рік тому +2

    Bravo! I'm starting to delve into creating a Metroidvania and you have really done an amazing job with this topic. I honestly didn't understand 90% of what you said, but i can tell you know what you're doing so I'll just use your techniques and try my best to replicate the settings until i understand everything better. Thanks!

  • @StealthyShiroeanGames
    @StealthyShiroeanGames Рік тому +1

    Wow, this is an excellent tutorial. I think some of it was over my head but I definitely will be tucking this away for when and if I ever need it in the future. I really love your analysis of the Hollow Knight camera as well. It gave me something to think about and challenged to me to be more analytical with games I play.

  • @FrozenFlameInteractive
    @FrozenFlameInteractive 8 місяців тому

    Absolutely incredible tutorial! Thanks so much for sharing this!

  • @REFRAME_267
    @REFRAME_267 2 місяці тому

    I love 2D GAMES that use wonderful camerawork.. so that Gamer find the right way or dare to explore.... Thanks a lot...the best camera tutorial ...:)

  • @masoncrowe
    @masoncrowe Рік тому +2

    It would be really cool to see how to implement the pan for when you push up or down in hollow knight. Also Zooming in and out! in some areas id like my camerato be more zoomed in and others zoomed out. Great video as always!

  • @deadbroadcastpc
    @deadbroadcastpc 4 місяці тому

    This is a great and informational video man! The coding is being done so fast though that it's hard to interpret what you're actually doing if you can't understand from the explanation alone. Other than that I'd say you've definitely accomplished a Hallow Knight camera!

  • @Ravisherrr
    @Ravisherrr Рік тому

    I personally don't work in unity but I enjoy watching all of your videos as they are informative. Keep up the good work!

  • @ekekw930
    @ekekw930 Рік тому +3

    Great video!

  • @iiropeltonen
    @iiropeltonen Рік тому +3

    Really great and I haven't seen many videos on this topic. I did feel the coding was a bit too fast even for an intermediate coder. The custom inspector was really interesting as I'm personally quite new to coding those.i liked how clean it made the component look with variable functionality ✌️✌️✌️

    • @iiropeltonen
      @iiropeltonen Рік тому

      I'm just gonna watch this again and see If I was too tired last time 😂

    • @TheOriginalDuckley
      @TheOriginalDuckley Рік тому +1

      No his videos are great but they’re so fast. That’s literally the only issue lol I have to rewind many times

  • @kenneth5095
    @kenneth5095 6 місяців тому +1

    Instead of doing anything of the direction bias part just increase the lookahead time it is honestly way easier and you barely notice the difference if you put the value at something like 0.20 and then play with the other values to make it look good. I was trying to make the direction bias work for an hour but couldn't. I believe just changing the lookahead time is better than doing allat showed here 3:30 but correct me if I am wrong. The same goes for the Y bias when.jumping or falling, just adjust the values in cinemachine

  • @auroth6805
    @auroth6805 9 місяців тому

    I am saving this video and naming it CameraMan

  • @coldpainhob4728
    @coldpainhob4728 4 місяці тому

    Hi,
    I watched a few of your videos and I must say you have the greatest tutorials that I ever saw for unity.
    unlike other content creators, you create practical tutorials, I really like it :)
    In this specific tutorial I think that you are missing something in your script (I am not sure).
    if you want that your script will be able to pan camera and switch cameras I think that you need to add to your
    swapCamera method you needs to add:
    _startingTrackObjectOffset = _framingTransposer.m_TrackedObjectOffset;
    otherwise in case of switching cameras and using a pan camera after it, when the player will leave the pan collider
    the script will return the m_TrackedObjectOffset to the values of the first camera and not to the current one.
    I also think that it will be better to use a private function inside swapCamera instead of duplicating the code
    you are probably doing in your code but you missed it in this tutorial :)

  • @Akigagamingstudios
    @Akigagamingstudios 2 місяці тому

    Awesome video! Great information here!

  • @teenymeanygames
    @teenymeanygames Рік тому +1

    Thanks for the tutorial. It's very helpful.

  • @rubencrespo9699
    @rubencrespo9699 Рік тому

    Thanks for this amazing tutorial, i've learned a lot

  • @ArenSpace
    @ArenSpace Рік тому +3

    Great tutorial! The only issue I'm having with the system is that if i go into another room and immediately turn around and go back in, the camera doesnt swap back to the room I'm actually in

    • @ArenSpace
      @ArenSpace Рік тому +2

      nevermind, I had the swapcamera call in OnTriggerEnter. I moved it to Exit and now we're all good XD

    • @pdstudio4477
      @pdstudio4477 Рік тому

      @@ArenSpace same happened to us....

  • @ronaldosenajr7015
    @ronaldosenajr7015 6 місяців тому

    Amazing camera system, thank u so much!

  • @hanhae99
    @hanhae99 Рік тому

    bro I really like your tutorial + i never managed to make my own hollow knight like camera system but one thing is that Team cherry uses perspective camera but your tutorial is based on Y Rotations. which means if we stick to the perspective camera(Not the orthographic camera) then i makes a z axis bounce. If you checked about this then your the best anyway thanks for this lovely video

    • @chillCatto
      @chillCatto Рік тому +2

      Have you solved z axis bounce?

    • @FluoLente
      @FluoLente Рік тому +1

      To avoid the rotation problem you could have the camera follow object interpolate it's position instead. Something like: distance * playerObject.transform.forward as a target location, so when the player rotates instantly on Y, the follow object then interpolates towards a desired offset location from the player but the z position remains a fixed value.

    • @hanhae99
      @hanhae99 Рік тому

      @@FluoLente thanks for the reply should try this when i get home !

  • @pocket-logic1154
    @pocket-logic1154 Рік тому +9

    Are you providing the code you're using here, inside the asset pack? The reason I'm asking is because you're writing code faster than anything described in Space Balls. I suppose it's either that, or a two hour video that no one would watch due to its length, but it's difficult to catch some of it, even when paused. Excellent content, nonetheless ;-)

    • @sasquatchbgames
      @sasquatchbgames  Рік тому

      eventually I will be doing that, once i can find the time to figure out the type of solution i want.
      Thanks for the support

  • @akael8350
    @akael8350 11 місяців тому

    Very thanks for the guide. I love your works.
    Just one improvement. If you have problem when you load new scene with the target player follow camera add in the camera manager :
    private void Start()
    {
    for (int i = 0; i < allVirtualCameras.Length; i++)
    {
    if (allVirtualCameras[i].CompareTag("CameraPlayer"))
    {
    allVirtualCameras[i].Follow = Player.instance.transform;
    }
    }
    }
    and change the camera follow player with a new tag : "CameraPlayer"

  • @nikhilvardhantawania4591
    @nikhilvardhantawania4591 Рік тому +2

    There are channels hidden like gems... Like Yours SUBBED

  • @niallg8918
    @niallg8918 11 місяців тому +2

    is there a place to look at the code as a whole I still get error messages after copying it letter for letter

  • @wardyom
    @wardyom Рік тому

    Your video is awesomen thank u so much !!!

  • @johnbarnhill386
    @johnbarnhill386 4 місяці тому +1

    For the Camera bounds part, in my project the confiner was completely ignoring the aspect ratio of the camera. I had to open the CinemachineConfiner2D script and replace var aspectRatio = state.Lens.Aspect with var aspectRatio = Camera.main.aspect * 1.181. I don't know why state.Lens.aspect doesn't work, and I have no idea why 1.181 is the magic number to make my confiner correctly respect the bounding box. Hope this helps someone :D

  • @fireraccoon_
    @fireraccoon_ Рік тому +1

    Holy moly Bro that is pretty nice stuff! I must admin for me as begginer was hard to follow some scenes you recorded but in the end i made it. I really like yours tutorials. All of them are simply diffrent connectig scripts etc I feel like I am learning Unity since beginning and what i already know is almost nothing;) PS. i cannot find anywhere how to properly ARCHIVE a finished and built game - put it somewhere to flash (outside of hardrive) and store it in a way that you can always easly acces to it and open and modify if needed. Are you able to record somethign liek this?
    cheers!

  • @ChrisMyt
    @ChrisMyt Рік тому +3

    Direction bias section from the video does not work with perspective camera, I get a weird zoom in and zoom out effect when turning, the z position gets changed for some reason on the camera
    Any fix for this?

    • @sasquatchbgames
      @sasquatchbgames  Рік тому +2

      You'll need to take a different approach for a perspective camera:
      A) forget about the 'CameraFollowPlayer' object - have the camera follow the player instead.
      We can just adjust the 'ScreenX' directly instead with this code:
      #region Direction Bias
      public void CallCameraFaceDirection()
      {
      _cameraFaceDirection = StartCoroutine(FacingDirectionBias());
      }
      private IEnumerator FacingDirectionBias()
      {
      float startPoint = _framingTransposer.m_ScreenX;
      float endPoint = DetermineEndPoint();
      float lerpedAmount = 0f;
      float elapsedTime = 0f;
      while(elapsedTime < _flipScreenTime)
      {
      elapsedTime += Time.deltaTime;
      lerpedAmount = Mathf.Lerp(startPoint, endPoint, (elapsedTime / _flipScreenTime));
      _framingTransposer.m_ScreenX = lerpedAmount;
      yield return null;
      }
      }
      private float DetermineEndPoint()
      {
      if (_player.IsFacingRight)
      {
      return 0.45f;
      }
      else
      {
      return 0.55f;
      }
      }
      #endregion
      Call CameraFaceDirection once in start, and each time the player turns around.
      Don't forget to get rid of any TrackedObjectOffset in the X that's already there.
      You'll need a reference to your player in the CameraManager, but that should do the trick

    • @Tigerwhite28
      @Tigerwhite28 7 місяців тому

      @@sasquatchbgames I'm a beginner and not sure what to do. Is anyone willing to explain this to me? I have a prespective camera but I don't know where to put this code

  • @Menderino
    @Menderino 5 місяців тому

    Isn't there a slight Parallax too? I was looking for guides in where the cinemachine supports parallax and camera bounds 😢

  • @benbrown3039
    @benbrown3039 Рік тому +1

    This is a great tutorial overall! I have one request though, when I was trying to break this after using it, I noticed that when you rapidly flip your character the camera bounces from left to right multiple times trying to keep up even after the player is done moving. Can you come up with a quick fix for this?

    • @Napori2021
      @Napori2021 9 місяців тому +1

      I have the same issue here. I think the problem is that all of the coroutines that were triggered will not stop until flipYRotationTime is run off. All of the coroutines fight for the rotation of the object at the same time, which caused the camera to jitter left and right.
      You can fix this issue by stoping the last called coroutine.

      public void CallTurn()
      {
      if (turnCoroutine != null)
      {
      StopCoroutine(turnCoroutine);
      }
      turnCoroutine = StartCoroutine(FlipYLerp());
      }

  • @_HoangQuangVinh
    @_HoangQuangVinh 5 місяців тому

    hello, i really like your videos, great job! And i have a question if i have more than one locked room do i have to create an additional cinemachineCamera for each of them?

  • @KalponicGames
    @KalponicGames 6 місяців тому

    Btw if you wanna build everything from scratch is like saying I am going mine all the minerals to build my pc . I think it's wrong conception that I must build everything from scratch. Plugins are awesome. It's like using intellisense in visual studio. 🎉

  • @hadefahmed3338
    @hadefahmed3338 4 місяці тому

    Hey, I know it's been a long time, but if you still remember, can you tell me why when you're drawing the player at player.X - xLvloffset, when he gets to 80% of the panel, you don't update the hitbox position also? Because when I draw the hitbox, I see that it is still moving, unlike the player.

  • @chadmoberly7044
    @chadmoberly7044 Рік тому

    Thanks!

  • @striferules
    @striferules 8 місяців тому +2

    Your tutorials are great, but I think you should do the coding part a little slower. It's hard to keep up

  • @alperakin2561
    @alperakin2561 5 місяців тому

    I have two cameras. One follows the player on both the x and y axes, while the other only follows on the x axis. When transitioning from the camera that follows on both axes to the one that follows only on the x axis, the camera first moves downwards but then moves upwards. What could be the reason?

  • @JarrettWhitehead-j3m
    @JarrettWhitehead-j3m Рік тому

    I've followed this step by step, and my camera works really well, except that it ignores the Cinemachine confiner. Is there an issue with the follow script overriding confiner bounds?

  • @DoubleOSevan
    @DoubleOSevan Рік тому

    Any idea why a positive X value in the Virtual Camera's Body -> Tracked Object Offset would offset the camera behind the player? It shows correctly in the editor, but once game starts it flips behind the character. A negative value positions it correctly like in the video. I suspect it's something in the code at runtime, but it looks identical to your code.
    Got a long ways to go, but tutorials like yours are a massive help! Thanks! ✌

  • @gaoqiangzhou9960
    @gaoqiangzhou9960 10 місяців тому

    great..great...

  • @omriyoffe366
    @omriyoffe366 Рік тому

    Great Video! Just one question, is there a way to make it so the camera will pan only after 1 second of standing on the ledge for example and not instantly?

  • @날드-i9t
    @날드-i9t 10 місяців тому

    할나 2D 카메라 시스템 ㅇㄷ

  • @AetherXIV
    @AetherXIV 8 місяців тому

    Here is a code version of his Framing Transposer Settings:
    void InitFramingTransposer()
    {
    CinemachineFramingTransposer transposer = vCam.GetCinemachineComponent();
    transposer.m_TrackedObjectOffset = Vector3.zero;
    transposer.m_LookaheadTime = .05f;
    transposer.m_LookaheadSmoothing = 1f;
    transposer.m_LookaheadIgnoreY = true;
    transposer.m_XDamping = .75f;
    transposer.m_YDamping = 2f;
    transposer.m_ZDamping = 0f;
    transposer.m_TargetMovementOnly = true;
    transposer.m_ScreenX = .5f;
    transposer.m_ScreenY = .5f;
    transposer.m_CameraDistance = 10;
    transposer.m_DeadZoneWidth = 0;
    transposer.m_DeadZoneHeight = 0;
    transposer.m_DeadZoneDepth = 0;
    transposer.m_UnlimitedSoftZone = false;
    transposer.m_SoftZoneWidth = .2f;
    transposer.m_SoftZoneHeight = .35f;
    transposer.m_BiasX = 0f;
    transposer.m_BiasY = 0f;
    transposer.m_CenterOnActivate = true;
    }

  • @ellimeido7964
    @ellimeido7964 Місяць тому

    Great tutorial. Can You please make the same camera sistem in Godot 4.3?

  • @jonathanstrong9764
    @jonathanstrong9764 Рік тому

    Nice video! Is this project file on gitgub?

  • @juanbelmonth1594
    @juanbelmonth1594 Рік тому

    Does it work in the already compiled version? The desktop version that you open from the icon

  • @桔梗qaq
    @桔梗qaq Рік тому +1

    very good ,but I cant see your code🥺

  • @andranikmag5240
    @andranikmag5240 9 місяців тому

    The direction bias looks weird on my project, i get a whole turn and see the sides of my project, and i am not sure where i went wrong. Does anyone posssibly know a fix for this?

  • @niallg8918
    @niallg8918 11 місяців тому

    I get so many using directive errors. Does anyone know how to fix it

  • @floodedfish
    @floodedfish Рік тому +1

    can you link the code?

  • @monkeypwners
    @monkeypwners Рік тому

    The bounderies do nothing for me. I have BoxCollider2D and CompositeCollider2D but it doesn't work. I can't even see the yellow outline for the bounderies on the Cinemachine Cam. Help

    • @monkeypwners
      @monkeypwners Рік тому +2

      If anyone has this problem, make sure to check the scale of your bounderies... I had expanded the collider using the scale of the gameobject and not the collider itself... Problem solved I guess!

    • @paulricordeau1370
      @paulricordeau1370 10 місяців тому

      man you just saved my life, i struggled with this issue for days X) so yes for anyone having the same problem with confiner 2d, make sure you scale the box collider with the OFFSET and SIZE of the Box Collider, not the sacle of the game object @@monkeypwners

  • @shangxiangsun3287
    @shangxiangsun3287 Рік тому

    anyone know which video had the Editor scipt

  • @petes5436
    @petes5436 Рік тому

    I'm not sure why the y damp doesn't get affected when the fall speed threshold is a negative value, I've tried everything

    • @HomelessHunt
      @HomelessHunt 11 місяців тому

      hi! did you find the solution?
      I have the same problem

  • @Ddotkay
    @Ddotkay Рік тому

    First off thanks for the tutorial, I am having an issue and Im not sure if its a bug on your end or just an incorrect implementation by me. When the player moves quickly between left and right and then goes in one direction the camera finishes the damping and then snaps to catch up but the snapping effect is quite jarring. Its hard to describe what i mean but hopefully you get what I mean.

    • @Napori2021
      @Napori2021 9 місяців тому

      I have the same issue here. I think the problem is that all of the coroutines that were triggered will not stop until flipYRotationTime is run off. All of the coroutines fight for the rotation of the object at the same time, which caused the camera to jitter left and right.

    • @Napori2021
      @Napori2021 9 місяців тому

      You can fix this issue by stoping the last called coroutine.
      public void CallTurn()
      {
      if (turnCoroutine != null)
      {
      StopCoroutine(turnCoroutine);
      }
      turnCoroutine = StartCoroutine(FlipYLerp());
      }

  • @kneo12
    @kneo12 3 місяці тому

    My camera confiner 2d doesnt work on build is there a solution?

    • @GogoZapper
      @GogoZapper 3 місяці тому

      The resolution of your computer is probably different than in play mode, and because of that it goes past the bounds. Try making the collider significantly bigger and try building again. If it works, that means the camera’s view was bigger than the collider so you might need to either make the confiner bigger or find some sort of workaround

    • @kneo12
      @kneo12 3 місяці тому

      @@GogoZapper Thanks for the reply but that's not the issue. I tried it and it didn't work.

  • @Zylath
    @Zylath 7 місяців тому

    can i please get the direction bias script

  • @zojirushi1
    @zojirushi1 2 місяці тому

    Do you have a GitHub with the source code?

  • @alecraigan4568
    @alecraigan4568 Рік тому

    Hello! for some reason as the confiner is not working correctly, I started working with polygon collider but I got tired of it and tried to switch to composite, I'm not getting any errors and I change the order so the cameras get the composite collider first and it should be working, but it's not, for the reason the camera just ignores the boundaries, any ideas what I can do?

    • @Westerncreek
      @Westerncreek 8 місяців тому

      I know its been a long while, but the solution is to set the scale of the cameracoliderobj on 1, and then change the sizes of the box colliders 2d to fit the shape(I was struggling with this for weeks)

    • @alecraigan4568
      @alecraigan4568 7 місяців тому

      @@Westerncreek thank you very much, if only I was more observant of the values on the video I wouldn't be having a hard time with the boundaries, too deep in my project to redo all the hitboxes but hopefully this will help someone in the future, have a good one 👍

  • @auroth6805
    @auroth6805 9 місяців тому

    why is this camera system more complex then any game I made

  • @GrilliBD
    @GrilliBD Рік тому

    my project uses the sprite renderer flip system to flip the player. Is it possible to make this camera system work in that way or is it necessary to use Y rotation to turn the player?

    • @TripFAU
      @TripFAU Рік тому

      A bit of a late response, but I skipped that part and it didn't impact anything else. The camera won't be able to give slight indication of the direction your facing though, it'll just remain locked onto you

    • @hadichamli
      @hadichamli 6 місяців тому

      I guess you could add two follow objects and change them based on which direction the sprite is flipped. (late response)

  • @oelwechsel
    @oelwechsel Рік тому

    Is there any Fix to the problem of the cinemachine 2d Confiner and the camera pan on edges? if the Boundary is too tight it will affect the Camera Movement

    • @sasquatchbgames
      @sasquatchbgames  Рік тому +1

      I haven't found a fix for it :(

    • @oelwechsel
      @oelwechsel Рік тому

      @@sasquatchbgames ok thanks for the answer. The video was a gold mine! Big thanks!

  • @adeleutamene7603
    @adeleutamene7603 8 місяців тому

    Can we get the full code?

  • @kenneth5095
    @kenneth5095 6 місяців тому

    Is the re anyone willing to give a copy paste of the code? I really need this for my game but I am running low on time. Please. Help

  • @SamuelWadah
    @SamuelWadah 6 місяців тому

    Can I implement it in godot?

  • @kenneth5095
    @kenneth5095 6 місяців тому

    Its telling UserInput does not exist in the current context when trying to do this part 3:36 can somebody pleaseeeeeee help me?

    • @kenneth5095
      @kenneth5095 6 місяців тому

      Code:
      private void TurnCheck()
      {
      if (UserInput.instance.moveInput.x > 0 && !IsFacingRight)
      {
      Turn();
      }
      else if (UserInput.instance.moveInput.x

    • @kingofspades9720
      @kingofspades9720 4 місяці тому

      He is using the new Input System that unity has, basically he made his own class to handle all the inputs for his game, which is called 'UserInput' so thats why you couldnt use it, instead you have to either use unity's new Input System or just use the old way.

  • @engineergaming3830
    @engineergaming3830 6 місяців тому

    you can also put the camera on a child object of the player (like a wallcheck) to get the offset without using any code

  • @BenedictLuis-d6c
    @BenedictLuis-d6c Рік тому

    is this using the standard 2d or the 2d urp?

  • @FortbloxNET
    @FortbloxNET 7 місяців тому +6

    as far as i understood the story of hollow knight, the devs are actual more familiar in creating good arts but less in actual coding. this is why they used PLAYMAKER in unity to use visual scripting more over actual coding the game. so i either they have a huge fucked up visual graph for the camera behaviour or this is way to much overthinking. super complicated. i don't think these 2 devs thought about sth like that and made it in visual scripting. there is probably an easier way and easier explanation.

    • @electrodev.
      @electrodev. 5 місяців тому +1

      make smth better then if ur so good

  • @sabeelm9
    @sabeelm9 9 місяців тому

    At 5:25 I had to change the tweening logic as it was incredibly buggy when the player was constantly changing direction. Here's my code:
    if (LeanTween.isTweening(gameObject))
    {
    LeanTween.cancel(gameObject);
    }

    LeanTween.rotateY(gameObject, DetemineEndRotation(), _flipYRotationTime).setEaseOutSine();

  • @Coco-gg5vp
    @Coco-gg5vp Рік тому +1

    First

  • @matiasgabrielarellanosanch5776
    @matiasgabrielarellanosanch5776 9 місяців тому

    4:54

  • @krumss
    @krumss 2 місяці тому +1

    The tutorial is good but hard to follow

  • @thebeangod7752
    @thebeangod7752 10 місяців тому +1

    Can you pls rewrite all this code using only "If" statements so i can understand it 😞

  • @talmalobani3144
    @talmalobani3144 Рік тому +1

    bro why u have so great tutorial but to get the code I have to sign up to your patreon this is so upsetting me i hope you make this code open source bec if not i will be very sad

  • @alperakin2561
    @alperakin2561 5 місяців тому

    hey i have a problem. Camera swap is working proberly when the player pass through left to right, but it doesnt work when the player pass through right to left.
    Here is the code:
    public void SwapCamera(CinemachineVirtualCamera cameraFromLeft, CinemachineVirtualCamera cameraFromRight,Vector2 triggerExitDirection)
    {
    if(_currentCamera == cameraFromLeft && triggerExitDirection.x > 0f)
    {
    Debug.Log("Değişti1");
    cameraFromRight.enabled = true;
    cameraFromLeft.enabled = false;
    _currentCamera = cameraFromRight;
    _framingTransposer = _currentCamera.GetCinemachineComponent();
    }
    else if(_currentCamera == cameraFromRight && triggerExitDirection.x < 0f)
    {
    Debug.Log("Değişti2");
    cameraFromLeft.enabled = true;
    cameraFromRight.enabled = false;
    _currentCamera = cameraFromRight;
    _framingTransposer = _currentCamera.GetCinemachineComponent();
    }
    }

  • @kenneth5095
    @kenneth5095 6 місяців тому

    For some reason it says that this code. Is not set to an instance of an object. How do I fix it. I already did everything in the tutorial. Pleaseeeee help
    CameraManager.instance.PanCameraOnContact(customInspectorObjects.panDistance, customInspectorObjects.panTime, customInspectorObjects.panDirection, false);

  • @tylercooper8824
    @tylercooper8824 4 місяці тому

    Thanks!

    • @sasquatchbgames
      @sasquatchbgames  4 місяці тому

      Thank you!!

    • @tylercooper8824
      @tylercooper8824 4 місяці тому

      @@sasquatchbgames As someone biting off my first solo indie game, your channel has been a breath of fresh air and a wealth of guidance! Thank you :D