How to Make a Enemy Target Lock System in Unreal Engine 5

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ธ.ค. 2024

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

  • @Goobsnoot
    @Goobsnoot 2 ปีที่แล้ว +36

    This guy has helped me with my entire video games career. I used to be stuck on everything He helps with such obvious stuff that nobody would make tutorials on and also some stuff I would never think on implementing into my game but it fits perfectly. there is rarely any “actually..” in his videos

    • @GorkaGames
      @GorkaGames  2 ปีที่แล้ว +4

      Thank you so much!! I love to hear that! I`m glad that I could help you in your game dev journey, I always try to make my tutorials straight to the point and, on subjects that are complicated, and turn them into a easy video to follow😄

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

      That_Is_So_True🔺

  • @maxlikessnacks123
    @maxlikessnacks123 ปีที่แล้ว +21

    "What's up guys? Welcome to new Unreal Engine Fuck Tutorial!" 💀

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

      thats how you know its good

  • @zachwise476
    @zachwise476 ปีที่แล้ว +7

    So helpful! With the Game Art degree I achieved at Full Sail University and the directions within your videos I will be able to accomplish creating at least one AAA level game.

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

    2:04
    Follow Camera -> Get World Rotation -> Get forward Vector

  • @SuperJohnsmith
    @SuperJohnsmith 8 หลายเดือนก่อน

    This is a good starting point and helped me plan out a more robust system, thanks for sharing!
    To anybody watching this in the future, be wary that this system does not exclude a few features that are required for a good lock on system such as:
    - Excluding targets hidden behind walls or who are already dead.
    - Swap to next target (left or right based on input)
    - Once locked on, the target can move out of range, so you will need a way for it to unlock from targets that exit a distance threshold. (Also for when they die)
    - A tether point or some kind of camera smoothing so it doesn't follow the player exactly. (You'll find this in games like Dark Souls)

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

      Just Use Tags on the light trace, from the option "Actors to Ignore"

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

      I was gonna say, "yeah but you can tweak it a bit and find other tutorials to fix those as they seem like minor issues" but you did say it's a good starting point which is true.

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

    That hair looks great on you and it has physics. Awesome Video

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

      Yeah 🤣 I love how the hair turned out. Thanks!

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

      @@GorkaGames Was the physics applied on the hair tutorial you made as well?

    • @GorkaGames
      @GorkaGames  2 ปีที่แล้ว

      @@AliBounds Yes!!

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

    love the video! but how can I make it so it locks gradually and not teleport??

  • @Zacharadus
    @Zacharadus 7 หลายเดือนก่อน

    Hey everyone, an unreal newbie here! Quick question, I've been wanting to implement strafing in my target lock system, if I left the Target Lock variable in and made it public, would I be able to use that to switch between animation sets? Thanks in advance, and thanks for teaching me so much Gorka Games!

  • @SuperBatAnimations
    @SuperBatAnimations 7 หลายเดือนก่อน

    Is it possible to do an auto lock on when you approach an enemy at a certain distance?

  • @atomicshrimpFT
    @atomicshrimpFT 2 ปีที่แล้ว +3

    Hi, usually you explain everything you create, but this time I felt like you needed to explain what you did at event tick. I’m still trying to grasp the concept of player controller and controll rotations. Could you proviedr a quick explanation maybe? Would be very helpful ❤️

    • @GorkaGames
      @GorkaGames  2 ปีที่แล้ว +3

      Hi, yeah of course, sorry if I might have left something there to explain. So the controller is a non-physical actor that basically possesses the player (in other words, what controls the player ). So I can access its rotation, and therefore change the whole player`s rotation with a new one very easily. So then I can find the direction between the player, and the targeted enemy, with that handy "Find look at rotation" node. Hope this helps and thanks for the support!! ❤

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

      @@GorkaGames Ok, but why doesn’t the player rotet towards the target then? Or is it because we only rotate the camera?

    • @GorkaGames
      @GorkaGames  2 ปีที่แล้ว

      @@atomicshrimpFT this is because we are not overriding the other controller settings. As the the Y- yaw control

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

      @@GorkaGames Set controll rotation doesn’t override the controler? That’s new to me. I guess I’ll just come back to it when I need it😂

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

      @@atomicshrimpFT yeah 🤣 something’s are just confusing but it’s how they work. So the camera boom is basically not being overrided by the controller

  • @DevilFruitJourney
    @DevilFruitJourney 10 หลายเดือนก่อน

    We need an updated video about combing this with strafe movements :)

  • @TacShooter
    @TacShooter 2 ปีที่แล้ว +5

    If you make a target lock, make it at the target's head only at CQB distances or long distances for a sniper. Otherwise, the target lock should be on the sternum / solar plexus (called "center of mass"), because that is how most soldiers are trained and how most people aim instinctively. The Rainbow Six series suffers from AI that aims for the head at any distance.

    • @GorkaGames
      @GorkaGames  2 ปีที่แล้ว

      yeah absolutely. The target lock should aim at the enemy's head, and right now it aims at the actor's pivot. But for this tutorial I was just showing how to make a simple targeting system, without going in so much detail, just focusing on the core of its systems. But if you were to add this into an accurate/ tactical game like Rainbow, I would agree.

    • @TacShooter
      @TacShooter 2 ปีที่แล้ว

      @@GorkaGames Yeah, but I mean that Rainbow Six games rely too heavily on targeting the head. It isn't realistic. For example, Larry Vickers when he was in Delta Force still aims "center of mass" when it is necessary to guarantee a hit.

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

    I have a question. As much as I can think, the lock will still work if the opponent is behind a wall. How to avoid that and also suppose there are multiple pawn in front of you it can decide which one to focus on depending on who got hit first but what if I want to switch between those players? I want something like in sekiro where if I try to move my mouse in focus it snaps to the next nearest enemy.

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

    Great tutorial as ever! If we want to switch between different targets moving the mouse or controller stick is it possible to implement? I cannot find any tutorial about that, thansk!

  • @traviszombeck7379
    @traviszombeck7379 10 หลายเดือนก่อน

    but what if i want to do 8 directional movement while locked on? how do i keep my character facing the enemy

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

    How do you apply this for example you want to target specific parts of an enemy like in 0Onster Hunter games where you break specific body parts?

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

    awsome tut!!
    couldn't find one on changing target lock? did u make that one too?

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

    Lol funny thing is, the boolean you said we didn't need, I actually do need it since I made a magic system and I only want the magic to hit the targeted pawn thus the boolean was needed for me to make it only occur if that bool is true~ Very very helpful

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

    Can this work for first person cameras?

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

    Hi! How can I make a target lock for a first person? I tried this way, but it only makes my player look at the location of the target, but not towards the object (for example, if its a little chair, it looks to the direction of the chair, but not the object). I hope you understand my problem, or if you could give me some advice here. Thank you! Love your channel

  • @svrvphimprod
    @svrvphimprod 9 หลายเดือนก่อน

    What do you mean by "break it"? I don't have good internet and can't see the name of the node
    Edit: I figured out that it was "break hit result" but it will not let me plug the out hit into it...

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

    Hey, this was really helpful but I was just wondering if there was a way to get the targeted enemy location?

  • @KS-lf9wu
    @KS-lf9wu 8 หลายเดือนก่อน

    Is anyone know a auto lock on for a top down I try to find everywhere only for third person character and that's it like doesn't exist pls i really need help

  • @Jordo95
    @Jordo95 8 หลายเดือนก่อน

    you are a god send, my friend. Always so thorough in your teachings.

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

    Nice video, I am trying to set it up so that when I kill the enemy, the camera returns to normal. The issue I am getting is that when the enemy dies, the camera always seems to take on the world location value and always turns my character to the same point (world location 0,0,0). Any way of fixing this?

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

      Have you tried creating a boolean check in your camera lock blueprint to check if the HitTarget actor has a particular flag for alive or dead, then check a boolean if the target is alive or dead. If dead, break the target lock. If alive, keep the lock. Hope that helps!

  • @dopeytree
    @dopeytree 5 หลายเดือนก่อน

    Get forward vector -> multiple splits into 3x for XYZ

    • @dopeytree
      @dopeytree 5 หลายเดือนก่อน

      ah needed to right click to convert to a single float

  • @synystyr6
    @synystyr6 8 หลายเดือนก่อน

    After testing it. I’ve got a Message log saying Blueprints Runtime Error. But everything runs smooth🤷🏻‍♂️

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

    Nice one bud ty

  • @dopeytree
    @dopeytree 5 หลายเดือนก่อน

    Awesome cheers for this :-)

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

    6:43 Snap back to reality

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

    but if you miss you have to double tap the lock on key to then lock on because of the flip flip being on B, is there any fix or work around to this?

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

      this is probably quite late, but this is where you want to use a Boolean with a branch instead of a FlipFlop.
      and only if the conditions are meet for target locking e.g. (HitResult = true and any other checks to confirm its an enemy ect.) then you set the bool to true.

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

      You can also just increase the radius of the trace, so the chance of missing is very sparce.

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

    This works, but I'm having issues with other axes of the camera. If a target is higher or lower than the player, or if I get too close to the target, the camera goes above me, looking down and I can't move forward. The control rotation changes like a compass and causes the forward movement vector to change on the player. Any advice?

  • @EVAN-xu2os
    @EVAN-xu2os ปีที่แล้ว

    Question how do I remove the sphere trace or make it invisible?

    • @Classymarc
      @Classymarc 11 หลายเดือนก่อน

      On the Sphere Trace for Objects node, set the Draw Debug Type option to "None"

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

    cool i like how you kept your hair

    • @GorkaGames
      @GorkaGames  2 ปีที่แล้ว

      thanks! yeah I love it 😄

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

    Nice this is added to the list of thing to be added to the game

  • @fatiherolmuhendislik
    @fatiherolmuhendislik 11 หลายเดือนก่อน

    Thanks a lot ! Very helpful tutorial.

  • @Messenger-1221
    @Messenger-1221 ปีที่แล้ว

    there is bug that stops the pawn from receiving damage

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

    This doesn't work for long distance. I am trying to do it for an aircraft spotting people on the ground. Also doesn't work if there are mulitple enemies..... SO basically serves no purpose I don't know a game that only has one enemy character.

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

    Thanks for the video. Can you make a video for throwing something and recalling it fly back to the hand? I think it super similar to this tutOrial. Thanks

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

      Yeah, do you mean like in God Of War with he's axe?

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

      @@GorkaGames Yes, exactly, and maybe the force in star war. Just simple toturials with the concepts. THanks.

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

    Thank you for the good video, but I'd like to give you a hint: the boolean you created in the first part of the video was the best way to optimize the logic. In the tick event, you should have made a check on that boolean instead of checking the validity of the pawn, because that's a lighter method for the compiler. However, the video is very clear, well explained and goes straight to the point, so thank you very much!

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

    1:49 my timestamp

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

    Next police system with stars like gta

    • @GorkaGames
      @GorkaGames  2 ปีที่แล้ว

      yeah good one! I actually have made it before for one of my games, I will see if I can make a tutorial about it

    • @frictiongamestudio7217
      @frictiongamestudio7217 2 ปีที่แล้ว

      @@GorkaGames yep there are not many tutorial about it

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

    The fact that this is so simple is infuriating.

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

    Not gonna lie o think I'm just Dumb because it's so simple it just his pace is fast and I don't even notice the detail I think I'm turning into sleepy joe😅

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

    CAMT MOVE THE MOUSE ON TARGET LOCK

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

    Dark souls 🤔🤔🤔