Unreal Engine 5.1 - Look at Mouse Cursor - Top Down Shooter EP.2

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

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

  • @bujny-games
    @bujny-games  2 ปีที่แล้ว +1

    More simple approach - th-cam.com/video/TJHv9oefrHg/w-d-xo.html
    More stable approach - th-cam.com/video/eAmY1gLdXjA/w-d-xo.html
    Previous Part: th-cam.com/video/1Hf_VhJGJUA/w-d-xo.html
    Unreal Top Down Playlist: th-cam.com/play/PL32YMM6O66N9ZCGD1mrqw__BcsxjZpkBt.html
    Unreal Short And Easy Playlist: th-cam.com/play/PL32YMM6O66N8_rX7SZCS9yaaN8zRmiHlE.html

  • @im_Dafox
    @im_Dafox ปีที่แล้ว +13

    Heads up for people who, like me, have the entire thing going CRAZY spinning : Make sure to go to your spring arm and UNcheck "inherit pitch/yaw/roll" or basically everything under "Camera settings".
    Also, thanks a lot for this series, really short and helpful :]

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

      Whew, thank you so much! I was putting this tutorial on top of another one I already did, and I was about to rage from the crazy spinning. I appreciate it!

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

      I have Inherit Pitch, Inherit Yaw, and Inherit Roll all unchecked and the spring arm still rotates with the mesh. What could I be missing?

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

    Heads up for everyone: this is based off of cursor casting a ray, and that ray hitting something. Your character will go nuts constantly changing rotation forward and backward if the cursor does not hit an object, so a quick fix is place a plane beneath your entire map, and tick off visibility so the ray hits a collision, then giving the hit result, but also you do not have an eye sore of a plane sitting there

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

    I've search for hours in forums and documentations.. your video and explanation was on point and exactly what I needed! You've earned a subscriber! :)

    • @bujny-games
      @bujny-games  ปีที่แล้ว

      Great to hear! Thank you.)

  • @HK-Labs
    @HK-Labs ปีที่แล้ว +4

    If you want the same functionality but only when you click (click to rotate towards mouse position), use Left Mouse Button instead of Tick and drag out from Pressed in Left Mouse Button.
    Thanks for the video btw.

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

      that works until your start moving, then rotation resets every tick anyway

  • @Flash_of_Stars
    @Flash_of_Stars 4 หลายเดือนก่อน

    Great video, very easy to follow and instructive:)

  • @sauravbhagat4150
    @sauravbhagat4150 5 หลายเดือนก่อน +1

    Thank you for this.

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

    Great explanation, thank you! How to do the same thing for the right thumbstick of a gamepad?

  • @sauravbhagat4150
    @sauravbhagat4150 3 หลายเดือนก่อน

    Hey thank you for this tutorial. It works great with the Mouse Input but I am facing a problem binding look at button to Controller. What to do ?

    • @bujny-games
      @bujny-games  3 หลายเดือนก่อน +1

      Hi, here is a tutorial for the stick. I hope it will be helpful. th-cam.com/video/V71sIt1vh0M/w-d-xo.html

    • @sauravbhagat4150
      @sauravbhagat4150 3 หลายเดือนก่อน

      ​@@bujny-games Thank you for replying. I found that tutorial and followed it and it worked well. However the character could not get back to the free movement and kept facing into that direction. I did some work around that and got that fixed too, but now I am facing a different problem with inverted Axis. I am using Gamepad Axis 2D with Index Dead Zone Type : Radial. Any Idea how to fix it ?

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

    thanks this help me a lot

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

    Works great with just one issue, if you have multiple meshes at different heights such as grates over a lava pit below, the character starts to glitch out as I believe what's going on is the cursor is sending hits out and registering the different positions of the meshes causing very subtle rotation as it calculates.
    Is there any way to turn the cursor hit detection off when over a static mesh?

    • @bujny-games
      @bujny-games  ปีที่แล้ว

      Hi, you can add check if collision is found by checking return value of GetHitResultUnderCursorByChannel. Also I'm going to make tutorial about rotation without collisions

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

      I solved this by placing an invisible plane with visibility collision on ground level, and set vis collision to "ignore" for all objects in the map.

    • @hugo-samson
      @hugo-samson ปีที่แล้ว

      I dont get what you're saying? The return value is just a boolean that check if it hit anything.. If it hits nothing it'll just not look anywhere@@bujny-games

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

    my game glitches out when the mpouse is in the top middle section of the screen. Through print I found that even though the mouse Z axis location should be positive, in this area it can't decide if the location is positive or negative and the rotation glitches out.

    • @bujny-games
      @bujny-games  ปีที่แล้ว

      but in this video we don't use Z axis of mouse hit result at all.... also you don't need to change rotaion from negative to positive because "Find Look Rotation At" will return good value if you use only X and Y values of character and target locations.

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

      @bujny-games I had it set to only x and y for the character. When I styay Z axis I mean my mouse position . It's all good though as I Jerry rigged a solution lol. I have it shoot a line trade from the mouse location and the player turns to look there, so far no issues.
      Great video though, certainly came in handy even with this fix 👍

  • @Mygamesworldiq
    @Mygamesworldiq 11 หลายเดือนก่อน +1

    thank you

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

    So this is easy enough to do, but I am having problems getting it to work with replication, it works fine server side, and client side, but clients do not replicate their rotation to each other or the server, I've tried various methods of getting the rotation to be handled by the server but I am running into a wall with no progress, any suggestions would be much appreciated.

    • @bujny-games
      @bujny-games  ปีที่แล้ว

      Hi, I think that you probably have problem with player index in functions like "Get Player Controller" or "Get Player Pawn"

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

    Even though orient rotation to movement is disabled, the character does not follow the cursor after moving for a while.

    • @bujny-games
      @bujny-games  ปีที่แล้ว

      Maybe you skipped something)) PS it’s the second video

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

      @@bujny-games I found out what is the problem. My game is isometric instead of top down, so it was affecting the vectors. I traced lines, problem solved.

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

    Well, my character only move when my curser is over something like a cube (the blue one in default template) or an actor. Otherwise, it does not follow the mouse. Any idea?
    Edited: Well to make it work, I had to go in the collision preset of the floor (SM_Cube) and change the preset to "Physical Actor" and now everything is working.

  • @_EliteKnight_
    @_EliteKnight_ 11 หลายเดือนก่อน +2

    Сэнк ю фор эназа месод.

  • @dorael_
    @dorael_ 8 หลายเดือนก่อน +1

    sank you for the tutorial

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

    the only thing that confuses me is that when there is an object in the way the character stops following the cursor and goes back to the default position until the cursor is back in view. Anyone got any good tips on how to fix that?

    • @bujny-games
      @bujny-games  ปีที่แล้ว

      Sorry, my bad, In this video I forgot about checking if hit was, you can use "Return Value" of GetHitResultUnderCursorByChannel

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

      ​​@@bujny-games where do i connect the return value of "GetHitResultUnderCursorByChannel"?
      Great tutorial btw, exactly what i needed

    • @bujny-games
      @bujny-games  ปีที่แล้ว +2

      Add "Branch" node and connect "Return Value" to "Condition" and do rotation only if "Return Value" is true

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

      @@bujny-games thank you

  • @아가리-y8i
    @아가리-y8i 3 หลายเดือนก่อน

    It's spinning along the mouse cursor too fast. Did I miss something?

    • @아가리-y8i
      @아가리-y8i 3 หลายเดือนก่อน

      아 해결 했다 ^^

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

    i need tis for mobile joystick

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

    i can't add the BP to the class setting inerithed interface

    • @bujny-games
      @bujny-games  ปีที่แล้ว

      you can't add the BP class because only interfaces allowed.

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

      @@bujny-games then i am missing some steps somewhere

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

    i cant split the pin for hit result 3:05

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

    Hotline miami :

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

    my screen is flipping hard

    • @bujny-games
      @bujny-games  ปีที่แล้ว

      Did you watch the first video?

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

      @@bujny-games i solved it, thanks

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

    oh my god the player controller is talking to the character via an interface. jfc