Unreal Engine 5 - Smooth Camera Collision

Поділитися
Вставка
  • Опубліковано 3 лют 2025

КОМЕНТАРІ • 92

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

    The issue I mentioned with the Target Offset at 16:00, I meant Socket Offset. Sorry for the confusion. Using any value besides the default 0,0,0 for the offset will cause the camera spring arm to stutter due to the offset causing inconsisten tracing in this system as the arm length shifts.

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

      Hi, thank you very much for your answer.
      Do you mean there is litterally no solution ?

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

      I did try something, but it wasn't quite fixing it. I left a comment on it earlier, but I deleted it, hence, the notification. If I figure it out, I'll update the comment. Basically, one approach is to not use a trace that ends at the camera location but at the end point of the spring arm at its maximum value. However, it can still result in undesirable camera behavior since there will be a slight difference between the camera-to-springarm vector and the aforementioned value. This is because it's not tracing exactly from the camera's point of view.
      There are other methods such as trying to create a system that adjusts the target offset depending on certain values but at this point, I think it might be better to create a different camera system that separates the springarm component from the player character. Until I find something, I'm sorry to say that you'll have to use it without setting a value to the target offset. Thank you for the comment.

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

      @@gotagamee
      Thank you so much for your enthusiasm.
      If you miraculously find a solution, i would be very grateful if you share it. Also, i'm working on it, and if i find something, i will keep you up to date, for sure.

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

      so this won't work if i have an "aim offset" setup using the socket offset then?
      although, the socket offset is only not 0,0,0 when im actually aiming down sights (when shooting ect)

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

      If what I'm understanding is correct, it should technically work. However, there will be some camera jittering occurring in certain situations.

  • @FunkyzeitGames
    @FunkyzeitGames Рік тому +10

    This is a great approach. I guess even smoother transition can be accomplished by using sphere mask in the material to cut a dithered hole into any mesh instead of the mesh disappearing completely.

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

      Yes, that would be a great improvement. The example here was just to provide an idea of a possible approach. Thank you for your sharing your thoughts!

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

      @@gotagameewow, I still have so much to learn. A lifetime doesn’t seam long enough.🫤

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

    Ayy ya know, I just happened to have this problem with the camera bouncing about on narrow passages and such. This smoothing helps a lot to avoid motion sickness while playing. Thanks a lot for sharing your expertise 👍

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

    What a smooth camera, great, thank you for the tutorial brother

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

    Dude, thank you for sharing your knowledge. I am struggling with the swing-arm colliding with the ground because of how I have it positioned for the character. Your method just may allow me to limit or set the length of the collision check, and avoid the problem I am having., it’s ingenious and just what I am needing at this moment in time. Thank you.👍😎

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

      I am happy that my video helped you out! It's a different approach, but if you want to hard clamp the pitch value, you could do that inside a custom player camera blueprint. I remember seeing a max/min pitch value or something similar exposed as a variable.

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

    This was incredibly thankful, thank you for sharing :)

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

      I am glad to hear that. Thank you for the comment

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

    Awesome series of camera tutorials, thank you!!! Adding a mouse scroll zoom to it would be cool (mine is now broken lol).

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

      Hi thanks for the comment. The mouse scroll zoom would probably be overridden if you followed the tutorial since it's using the line trace's blocked point as a distance reference. You could try having the zoom function modify the maximum distance for that part.

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

    Smooth tutorial !

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

    I love this video. great tutorial and explanation, thank you.

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

      Thank you for your comment! I hope it helped!

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

    Thank you for this tutorial! I am really grateful to you!

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

      I'm glad you found it helpful!

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

    great video, thank you!

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

    Great tutorial! Thanks so much for sharing :)

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

    Thank you for your help. I was able to integrate this into the camera system I setup akin to the ALS v 3 camera system where the camera and spring arm values change depending on the character's state. I think I'll try to introduce a camera reset option next. Do you think you could do a video where you solve the socket offset issue? Thanks again!

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

    Nice tutorial. Gonna try this out for fun.

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

    Hi, thank you! Would that system also work for an over-the-shoulder-perspective?

  • @구준모-u1t
    @구준모-u1t Рік тому

    So smoooooth

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

    Hi, i have a problem with the socket offset of the Spring arm, but don't know how to fix this.
    The problem = there is jittering issue when the collision occur to the really begin of the sphere trace.
    Your suggestion at "potential issues" chapter does not fix the issue.
    Do anyone have a solution to exactly define the camera location for the end of the Sphere trace channel ?

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

      Please tell me you found the solution for this I need it!!!!

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

    about the "dither" effect. is there a way to make it in a postprocess instead of an obj by obj

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

    Hi, this is a fantastic tutorial and very much needed. I have a question, when the character is very close to a wall and the camera moves closer, sometimes it moves right into the character's head and you get the transparent head effect with you seeing the characters eyes from within its head LOL. Is there a way to rectify this? or have i done something wrong in my setup. Thanks

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

      Hello, happy to hear the video helped you out. So, from what I understand, an easy fix would be to position the spring arm outside of the character's head. A good place would be on top of it with some leeway. I'm assuming what you're experiencing is the camera clipping inside the character's mesh. This method I mention should be enough to handle your situation unless you have some specific needs for your game. I hope it helps.

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

      Thanks for the fast reply. yes it was the camera clipping into the character mesh. that did indeed fix it. @@gotagamee

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

    Hello, the tuto is really great !
    I just have 1 issue. The shadows also dissapear when the Material get less opaque.
    Do anyone have an idea to still « hide » the Material but not shadows ?

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

    Cheers for this! Helped me out on a current Camera system I am working on!
    Wondering if you can help me on another aspect on it that I haven't been able to get much results on it yet (most probably I just haven't figured out the maths behind it yet)
    Is there a way to "stop" the camera on following the spring arm?
    In a context where when a player enters a box collision, you can have the camera remain on the overlap/impact point

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

      I'd imagine you'd probably have to detach the camera from the spring arm for starters, under the assumption that you want to use a single camera. I think another approach is to just create a new camera on the desired spot when the intended trigger is overlapped and blend the view target to that camera.

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

      @@gotagamee Thanks for that detachment idea!
      With that in mind I managed to get my camera to act how I want it in certain areas! :D Cheers mate!

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

    i used from the "break" the distance variable and used lerp instead of finterp, same result

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

    ID보고 일본사람 영어 잘하네 생각했는데 한쿡 사람이네요 ㅎ. 잘 배우고 갑니다.

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

      감사합니다! 도움이 되었으면 좋겠습니다~

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

    hoy guy ! 20k view and 988 followers.... Comon i guess his tuto well explain help us a lot so follow !

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

      Thank you for the nice comment!

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

    Hi there! Awesome video! I was wandering if it possible to give a different interp speed based on Actor Tags ( I would like to give it a value of zero just for the landscape ).
    Thank you so much!

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

      Sorry for the very late reply. It would be possible as long as you can get the tags of the colliding actors' tags for the camera trace. Thank you for the comment.

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

      @@gotagamee No problem! Using actor tags works as long as you're using "Is Valid"
      Thank you very much!

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

    What Value do you have the InterpSpeed set for? You never revealed that when doing your walk through of the Get Interp Speed function.

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

      I went over briefly, so you might have missed it. You can check it out from 12 minutes into the video. Hope it helps.

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

      @@gotagamee They mean the actual variable for Interp Speed, I can't seem to find it either. I've looked over that part several times and you don't show it. You do talk about it, but you don't click on the variable to show the value. And I'll be honest, I got really confused with all those numbers you were saying so I don't know what the right number was 😅
      Edit: I figured it out after some testing and now what you said makes sense! If I'm correct, your variable is set to 0.8. I tweaked mine to be .015 (I moved my third person camera to be closer to top down) and I really like how smooth it is! Thank you for this tutorial and thank you for explaining how everything works! Lots of people tend to just say do this and you're done but you took the time to explain and I really appreciate that

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

    Great video! I was wondering how the camera reacts to the floor? Does it still move through the floor or do you have a normal collision set on the ground? (if so... how? )

    • @gotagamee
      @gotagamee  10 місяців тому +2

      Hello, thank you for your comment! It would depend on how you set up your collision. If your camera springarm's setup to collide with the floor, it should be blocked by the floor.

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

      @@gotagameeThank you for your reply! Could you explain it a bit more? At the start of the video you turn of 'Do collision test' for the springarm, so I can't easily turn on collision with the floor, right? or do you mean to make a second sphere trace that checks for collision with the floor?

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

      Oh I might have made a confusing reply. To be more accurate, the collision trace that checks collisions for this system should be on set to use a channel that collision with the floor.

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

      I don't know if you found a solution, but for anyone who wants their camera to collide with the floor or anything else here's how you can do it: Pull out from your line trace break hit result hit actor and check if actor has tag. Name the tag something like "Camera Collider" and put it into a branch after your blocking hit branch. if true, set "Do collision test" of your spring arm component to true, and if false set it to false and continue to set your impact point. Then just give anything you want the camera to collide with the tag you created.

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

    Awesome tutorial! I wish there were more tutorials on enhancing the default UE camera. The only issue this set up creates is see-through walls. Do you have any fix for it? For now I will try using different camera channels and the one for walls with "do collision test" enabled.

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

      Thank you! If I understand your question correctly, you could try adjusting the interpolation speed to a faster speed.

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

    Hello..🖐! Looking for a bit of help here. I have a character set up with a third person camera, everything works well except for the fact that when my character is moving (playing animations) the spring arm seems to collide with the player and causes the camera to jump forward. I believe it is the spring arm collision because if I disable “Do Collision Test” in its properties, the animations no longer make the camera move, however the camera will now clip through the floor and all other objects (as expected with no Collision Test)

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

      You can try checking for the trace channel inside the LineTeaceByChannel node and see if it's using the Camera channel. If you have changed something with your collision settings, that could be the cause of the issue.

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

    when it comes to collisions.. lets say i have a pylon with 1k vertices.. would it not be the best for performance to put in a low count colision box in place of the the pylon ? and make collision with that instead? just turn the object invisible to players.. now i have a maybe 32 vertices collision object instead?... would this be the correct way to do it?...

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

      I do think if it's not critically important to your gameplay in terms of game design, if you can lower the complexity of collisions that are set up, it would be beneficial.

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

    Hey ! i'm new to unreal and blueprint/dev, currently trying to do a little game and i came here because i got the spring arm who do instant move when it collide. i'v tried your solution but it don't work properly in my game ( it's a fast game and i still got clipping when moving the camera).
    But maybe i got an idea that you could manage to work since i don't really know how to do it !
    Maybe instead of moving the camera every tick when the sphere trace collide with something, we could try to keep the camera movement to go the point it collide but when the camera reach it we just enable the "Do Collision Test" of the spring arm and stop moving the cam since it will do it alone, when we enable this i think we need to do something so it only happen once and not every tick, and when the camera go away and there is no collision we keep the movement so she go the spring arm max length and then disable the "Do Collision Test".
    Sry my english is not really great and since i'm still new to this it could be confusing, i hope that you'll understand what i meant and it is something that can work

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

      Hello. It feels like quite a different approach, so it's hard to tell. If your game is a fast game, I think you could try cranking up the interp speed to a higher value for starters.

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

      @@gotagamee thank you for your response !
      i did try to change all the value i could to see how it react, but i will test it again just in case.

    • @田禾子
      @田禾子 8 місяців тому

      hey, could you teach me how to trigger it by only happen once? I'm also dont like to use tick but I can not find a proper way to complete it. really thanks,

  • @Messenger-1221
    @Messenger-1221 4 місяці тому

    not sure what i did wrong but the camera does nothing but clip. no springing back at all

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

    Sorry, I'm yet to look into the videos, too many things ongoing..but i wanted to ask..which would be preferred to use/follow, this (smooth camera collision) or Auto Camera adjustment

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

      The two are separate features that you can try and use simultaneously! Smooth collision to prevent camera snapping back and forth, auto camera adjustment for automatic camera rotation. Thank you for your interest!

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

      oh ok thanks a lot for these wonderful tutorials
      @@gotagamee

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

    Im interested in your lighting setup

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

      Hi, thanks for the comment. I haven't actually touched any settings for the scene regarding lighting as far as I remember. Although, it is possible I may have had raytracing and and lumen turned on.

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

    hi, what are u setting in the end? set what? how to call it ?

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

      It's hard for me to understand which part you need clarificiation about. If you could provide more info on which part that'd be great(timestamp, exact time in the video etc.)

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

      16:00 all your nodes coming to set something, but i dont get what u setting in the end. it is a set node and 2 targets blue and green and i dont know where u get that node from@@gotagamee

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

      Ahhh, so that's the SpringArm component. If you see on the upper right side of the screen where the tab says "Components", I have a "SpringArm" that has a Camera attached to it called "Follow Camera". If you want to get a reference to it, you can right click inside the graph editor and type in your SpringArm component's name or simply click and drag it into the graph editor. I hope that's the info you needed. @@SAYRESS

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

      well thats how i get "get spring arm" but not how i set it.. when i type "set spring..." i see only "set default spring arm" option, like green variable name. and no other options @@gotagamee

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

      wow i found out how to set it... that is rly not obvious... @@gotagamee​

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

    Does this work with camera lag ?

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

      Hello. Yes it should work. However, I would recommend to consider potential issues to I explain in the video.

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

    Sell this as a Marketplace product. I'll be your first customer.

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

    Pretty Ass video, should of shown how to do it, instead of explaining what you did

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

    Please make a tutorial on procedural human walking animation, there is NONE in youtube for begginers or they are for non human creatures with extra legs, please

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

      Thank you for the comment and suggestion. Although I do think procedural animation is a topic that's more of an intermediate~advanced level to go over, I will take a look into it in the future.

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

      @@gotagamee would be highly appreciated.

  • @hashimshah7732
    @hashimshah7732 11 місяців тому +3

    Not working. Camera is shaking going back and forth after colliding with the object. make another one with complete details

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

      That’s some kingdom hearts 1 camera action you got there

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

      + I don’t suggest using BP code for any camera logic involving collision. This is every tick, is obviously instantly better performance doing it in C++.