HOW TO CREATE: Fixed Camera System (Classic Resident Evil) in Unity

Поділитися
Вставка
  • Опубліковано 28 лип 2024
  • This is my second ever tutorial video about how to create Fixed Camera seen in Classic Resident Evil games - I'm sure there are more optimised ways to achieve this but I found this way to be simple and works well!
    Music by:
    / octonyte
    Tank Controls Code: answers.unity.com/questions/1...
    If you have any feedback on this then let me know, I haven't created many tutorials so I'm sure there's some stuff I could improve here.
  • Ігри

КОМЕНТАРІ • 89

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

    wow that demo looks crisp and beautiful. i'm in love
    Edit: i found your video by searching: *unity fixed camera*
    it was the #1 result

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

      Ayy! Glad the keywords helped someone :D

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

      @@Hennejoe Yes, it just appeared to me. It seems YT is starting to recommend smaller channels for us, it's happening to me and my friends all the time. I hope it continues like this!

  • @shakes2170
    @shakes2170 2 роки тому +1

    Yessssss, been a while since you uploaded, been waiting for this, one of my favourite speedrunners, keep on uploading and grinding.

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

    Thank you so much for uploading this😢 have been looking for this tutorial for hours

  • @Mattyelele
    @Mattyelele 2 роки тому +1

    Awesome tutorial Joe!! Love to see more tutorials like this

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

    HOLY COW this is so simple and yet so effective!! Thanks!!!

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

    The greatest tutorial Ive seen. So helpful. Thank you Million 😋😋

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

    I am looking for this to use in my project, and i did exactly what you say in this video, has been so useful, thanks very much!!

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

    thanks so much! its way simplier than i thought. Its good that you showed how it looks like in a demo too!

  • @regys9521
    @regys9521 2 роки тому +1

    exactly what i was looking for! thanks

  • @naibaf99
    @naibaf99 2 роки тому

    Excellent tutorial! Thanks a lot

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

    HI ! I'm a beginner on unity and its very useful !! Thank you !!

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

    I appreciate the help man. 👍👍👍👍👍

  • @nobodyknowsorcares6122
    @nobodyknowsorcares6122 2 роки тому +4

    Hi Joe!
    I got to know you from your amazing Prince of Persia speedruns. I wish you did more videos about that, perhaps making some tutorials or demonstrating glitches could be something to consider. Regardless, thanks for making videos, love your voice and your way of explaining things. Hope you continue :)

    • @Hennejoe
      @Hennejoe  2 роки тому +2

      Definitely would love to make pop content but haven't had much time for videos recently with that

    • @nobodyknowsorcares6122
      @nobodyknowsorcares6122 2 роки тому +1

      @@Hennejoe Understandable, then best of luck to you with whatever is keeping you busy in life :))

  • @rodmileski
    @rodmileski 2 роки тому +1

    well done mate

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

    Bro, amazing

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

    Great stuff. Subbed. Would love to see more…

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

    helped a lot

  • @AFXSnares
    @AFXSnares 2 роки тому +1

    Doing god's work

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

    How to create a pre-render background like RE??

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

    Hey, great video! I want to have first person + fixed camera angles like these at some places in the game (but mainly first person). Do you know how to do this?

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

    Awesome video this is exactly what I needed! One thing I am noticing though is that these virtual cameras dont have Culling Mask build in, like if I needed a wall to be invisible when a specific camera is active, do you have any insight towards that?

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

      Inside the virtual cameras settings under the "Lens" section there's a slider called "Near Clipping Plane" that lets you set a minimum distance away things need to be before the camera will show it. By default it's set to 0.3, but adjusting it higher will push it further in front of the camera and cause it to not display walls that block the view.
      Only issue you might run into unrelated to this tutorial is if you're trying to use something like cinemachine's ClearShot camera, as while the wall isn't visible in the game view it's still technically in the way and will count as blocking the camera from seeing the target, which will prevent it from ever being swapped to. But in this case where there's manual trigger boxes for camera swapping it works good

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

    could you also do a video on how to make dynamic camera angles? like in the silent hill games where the camera is not exactly fixed but also moves with the player. Until Dawn also uses this

  • @TayMcQuaya
    @TayMcQuaya 2 роки тому +4

    is there any way to have modern controls too . you mentioned in the video that with modern controls where the player faces related to the camera can make you exit a scene which just has been entered when you hold the input. whats the way to avoid this at modern codes, are you planning on making a tutorial about this too?

    • @Hennejoe
      @Hennejoe  2 роки тому +1

      There is a way to avoid this with camera relative controls but I wouldn't make a tutorial for it as I still don't think it's preferable
      You need to store the direction you're holding every time a camera is switched and only update to the new camera orientation after that direction is let go and pressed again

  • @Alexander-yd3kn
    @Alexander-yd3kn Рік тому

    Really good tutorial thank u! Can u explain how to animate character? I got character with your movement code, got animations: move and idle in animator, but how to trigger it? :D My character got just idle animation and moving with it too

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

    You should do a mgs1 camera tutorial

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

    This tutorial was super helpful, but the CamSwitcher script did not work for my 2D game. After searching for the answer, the solution was to replace OnTriggerEnter, OnTriggerExit, and Collider with OnTriggerEnter2D, OnTriggerExit2D, and Collider2D. You will need a Rigidbody 2D and Capsule Collider 2D on your player.

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

    My cameras are blending between them. How to fix it?

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

    This video is pretty good and I definitely appreciate you making it. However, unless I missed something, why are you tracking the transform of the player in the CameraSwitcher script?

    • @Hennejoe
      @Hennejoe  8 місяців тому +1

      Just a leftover from when I was doing the script another way but I forgot to rerecord the clip for that bit!

  • @dylanreed935
    @dylanreed935 2 роки тому

    My camera switches to the 2 one when i start

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

    I have the exact same code, but I'm using more than two cameras. Anyways, the cams don't switch, I don't know why :(

  • @youngm.a.2464
    @youngm.a.2464 2 роки тому +1

    Help! I cannot drag the player into the TriggerZone material box!

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

    Nice work! Whats is the name of this game?

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

    Thanks for this tutorial! it worked for 2 cameras but not when I add multiple ones, is there a possibility to add more?

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

      This will work with any number of cameras as long as they each have the camera switching script + trigger

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

      I'm having the same issue

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

      Sry. it does work. But it starts out jank. i have to touch two different triggers and then it desides to start working. it being silly

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

      it goes through some jank priority order

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

    I have an idea for a horror game but I don’t know anything about the software

  • @gmangman123
    @gmangman123 2 роки тому

    thx for tutorial dude!
    Can camera transitions be delayed like in resident evil? millisecond delay time would be nicer.

    • @Hennejoe
      @Hennejoe  2 роки тому +1

      Yup!
      You can define the camera transition in the Cinemachine Blend options in the Cinemachine Brain Component

    • @gmangman123
      @gmangman123 2 роки тому

      @@Hennejoe Thx my friend.

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

    so there is a way to keep the trigger zone checking if the player are there? lets say i have a room with 4 doors on it so the player can go in that room from 4 differents places or scenes, everytime i load that scene the camera will always be the first one on priority instead the one the player are triggering the zone

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

      Whatever you've set the active priority to in your script, make sure all your cameras are below that priority in the inspector before hitting play and it'll update the one the player is in on start

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

      @@Hennejoe thanks bro, i have one more question, do you how to transport player into a scene to another on a especific location in the map?

  • @K.a.Z__
    @K.a.Z__ 4 місяці тому

    does anyone know how to make the transition between the cameras instant, instead of a swaying transition?

    • @Hennejoe
      @Hennejoe  3 місяці тому +1

      In the cinemachine brain, change the transition to cut instead of the default blend

  • @lorenzobrown1003
    @lorenzobrown1003 2 роки тому +2

    My cameras switch but they do a little transition instead of immediately switching.

    • @lorenzobrown1003
      @lorenzobrown1003 2 роки тому +4

      I ended up solving my problem. If you already have a main camera, cinemachine adds a brain component to that one. You have to change the update style to cut.

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

      Lol thank you

  • @deadend85
    @deadend85 2 роки тому +1

    I am having a very odd bug, it works for the first camera switch, but then after the second switch of the camera 2 of the zones turn to 1 and no other trigger zone works after that, also when it switches once if i go back to the starting trigger zone it does not switch back. The camera goes from 10 to 0 and doesnt go back to 1 once you leave and try to go back inether. any idea on why this is?

    • @Hennejoe
      @Hennejoe  2 роки тому

      I don't know why that would be!
      Do you have a screenshot of your code?
      In the video you can see it should work for multiple switches of the camera no matter if you go back and forth

    • @deadend85
      @deadend85 2 роки тому

      @@Hennejoe here is my code:
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using Cinemachine;
      public class CamBehavor : MonoBehaviour
      {
      public Transform Player;
      public CinemachineVirtualCamera activeCam;

      private void OnTriggerEneter(Collider other) {
      if(other.CompareTag("Player"))
      {
      activeCam.Priority = 1;
      }
      }

      private void OnTriggerExit(Collider other) {
      if(other.CompareTag("Player"))
      {
      activeCam.Priority = 0;
      }
      }
      }
      i have insured that the Player has been set up properly and the triggers are linked to the right camera.

    • @deadend85
      @deadend85 2 роки тому

      i found the issue, i had a typo

    • @Hennejoe
      @Hennejoe  2 роки тому

      @@deadend85 only just seen this but yes, eneter -> enter should be all you need!

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

    Do you think this would work in Roblox Studio?

  • @zak-ks7ee
    @zak-ks7ee Рік тому

    do you have any advice on how to make it so that the camera follows thwe player in larger scenes/environments like in FF7 origanal. So far, I have only seen cameras that remain in a fixed position and am trying to make it so that the camera follows the players in scenes like long hallways or city parks. does anyone have an advice on that?

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

      Theres a cinemachine component that will let you dolly along a track, I don't remember the exact name but it's got dolly in the name!
      Probably best to look up another tutorial for it though, won't be able to explain it through text I think

    • @michaeljustinw
      @michaeljustinw 11 місяців тому +1

      Use "Look At" at Cinemachine Virtual camera component, and select your player gameobject, thank me later

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

    I used your tutorial, and everything works as it should, except that when the player moves from camera to camera, it’s a long transition instead of being instantaneous. Any ideas about why?

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

      Set the default blend in cinemachine brain to cut!

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

      @@Hennejoe thanks, I’ll give it a try!

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

    Huh.
    Whenever mine starts the camera immediately changes to the 2nd camera despite the player not being there. After the player moves into the trigger for the second one and back it then swaps back to the first one and you swap normally.
    Anyway to stay on the first camera? Codes here.
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using Cinemachine;
    public class CamSwitcher : MonoBehaviour
    {
    public Transform Player;
    public CinemachineVirtualCamera activeCam;
    private void OnTriggerEnter(Collider other) {
    if(other.CompareTag("Player"))
    {
    activeCam.Priority = 1;
    }
    }
    private void OnTriggerExit(Collider other) {
    if(other.CompareTag("Player"))
    {
    activeCam.Priority = 0;
    }
    }
    }

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

      Before you press start, make sure the camera priority you want to be first is higher than any other

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

      @@Hennejoe Uh, how?

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

      @@Hennejoe Nevermind, figured it out!

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

      @@kinnie9918 Hey, probably a little late, but can you tell me how you fixed the issue because I am having it as well?

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

      @@TheGeekCraft oh, basically you need to make sure every single camera has a priority of 0 in cinemachine's configuration

  • @batman-cg8br
    @batman-cg8br 20 днів тому

    OS CARACTERES ESTÃO MUITO PEQUENOS PRA SE VER

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

    For some reason when I play the game the first camera doesn´t stay in place but it moves towards the second one. Could you help me with this issue?

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

      What are the priority levels for each camera

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

      @@Hennejoe The same ones in the CamSwitcher script you wrote. 1 and then 0 I am sure I wrote the code correctly I double checked.

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

      @@Toffifex in the inspector though, what does each one say at run time

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

      @@Hennejoe Oh, well in that case they both say 10.

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

      @@Toffifex sounds like the script isn't working for those cameras! Are you able to paste what you have exactly?
      Also make sure that the script is applied correctly and all the variables have been assigned

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

    Umm does anyone know why my camera plays an animation when it switches

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

      Nevermind I found out it had something to do with the main camera

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

      @@spiff232 what did you do to fix it?

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

      @@tobiasnilssenopedal6660 I had a main camera and changed the transition

  • @Frag.112
    @Frag.112 Рік тому

    Why is there a public player variable in the script? You never use it