How To Create A Homing Projectile - Unreal Engine Tutorial

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии • 104

  • @MDLuffy1234YT
    @MDLuffy1234YT 2 года назад +25

    7:58 Depending on what you want your target to be, you actually need to set the class to your target's requisite collision component. Not doing this results in the bullet always aiming towards the floor beneath the target.
    For example, if the target is a player or an enemy, you need to set the class to CapsuleComponent so that it aims towards the center of the target.

    • @megtwin
      @megtwin Год назад +2

      I tried this but it will not allow me to select capsule component, it keeps changing it to capsule collision. How did you get it to accept that? I'm using v4.26

    • @dodoche6451
      @dodoche6451 8 месяцев назад

      YES B.A.B.Y !

    • @Doubleaa500
      @Doubleaa500 3 месяца назад +1

      @@megtwin In the component class drop down thing, type in "collision" and it should pop up with things for you to try. I have a sphere and just used "Sphere Collision" and it goes straight toward the ball instead of hooking toward the bottom!

    • @megtwin
      @megtwin 3 месяца назад +1

      @@Doubleaa500 Thanks for the info!

    • @Doubleaa500
      @Doubleaa500 3 месяца назад

      @@megtwin No problem!! I hope that helped!!

  • @Chooch_The_Dog
    @Chooch_The_Dog Год назад +6

    you know, you did in 11 minutes what other tutorials do in 1.5 hours. Thank you for being concise!

  • @Kieza-
    @Kieza- Год назад

    Awesome Tutorial, for anyone who is wondering why their projectiles are landing at the targets relative 0,0,0 location, the simple solution is within the "Find Homing Target" function of your blueprint, instead of "Get Component by Class", instead break out of your "Homing Target" reference and cast to your targets blueprint, then out of that you can reference the capsule component or even any component that lies within this blueprint.

    • @bungobilbo5709
      @bungobilbo5709 5 месяцев назад +1

      I'm not fully understanding your description, would it be possible to explain in more detail (I know it's been a while)

  • @davidabruzzo7327
    @davidabruzzo7327 Год назад +2

    Thanks , in ue5 there is a now a node call "find nearest actor", this node make the calculation for the distance . It could be cool if you can remake this very good tuto for ue5.

  • @stormrungaming
    @stormrungaming Год назад +1

    took me 3 days.. but this is the tutorial that worked. Thank you!

  • @user-yuri665
    @user-yuri665 3 года назад +1

    I swear you're the best UE4 tutor when it comes to blueprints 🥺

  • @soulcakelive
    @soulcakelive 3 месяца назад

    This is exactly what I needed, thank you so much!!

  • @noisyether9211
    @noisyether9211 Год назад +1

    Hello how would i get it to switch targets. Examle just like in real life when a jet is targeted but it shoots flares. Now the flares are the target.

  • @happy-oni9240
    @happy-oni9240 3 года назад

    Only ue4 channel I watch for fun and learning. Thank you.

  • @ignacio-sanchez4646
    @ignacio-sanchez4646 3 года назад +7

    So nice tut. The best ue4 developer of yt

  • @닭돼지-u6t
    @닭돼지-u6t 3 года назад

    It is the best UE tutorial videos I've ever seen

  • @abdullahsohail5395
    @abdullahsohail5395 3 года назад +5

    What a video absolutely amazing great video . Thanks for making these helping video

    • @MattAspland
      @MattAspland  3 года назад

      Thank you so much! Always happy to help :)

  • @Galvatorrix
    @Galvatorrix Год назад +2

    I have made 3 separate homing projectile tutorials including this one now and Neither of them work or track to the target, can you help?

  • @noisyether9211
    @noisyether9211 2 года назад +1

    Thank you and leared a lot just now too.

  • @neosinan1
    @neosinan1 Год назад

    Thank you man, This really helped

  • @Faizy_Writes
    @Faizy_Writes 3 года назад +4

    NICE!!!

  • @stevewynn4612
    @stevewynn4612 3 года назад +3

    Super tutorial. Amazing how you keep coming up with great content.

  • @Phoenix_VR
    @Phoenix_VR 2 года назад +1

    Awesome tutorial, may I ask how to set it up to something like Laser Designation? meaning, to start homing on a specific target when a laser hit that target?

  • @Ausyaustingaming
    @Ausyaustingaming 2 года назад

    Is there a way to select which target I’m making a backyard football game so when I throw the ball it goes to the person and the catch it

  • @jephrennaicker4584
    @jephrennaicker4584 Год назад

    Great video, Think this could updated ue5? could not get this working

  • @bungobilbo5709
    @bungobilbo5709 5 месяцев назад

    This works great for static objects but (unless I did something wrong) I need the projectile to "Chase" its target until it hits. As it stands the projectile will hit the ground where the target was at the time of firing.

  • @AzaGorod
    @AzaGorod 3 года назад +1

    Might there be a way to target a specific bone on a target? I got it somewhat working but it always homes in on the bottom(feet) of the actor.

    • @w47-p1e
      @w47-p1e 2 года назад

      Yes you can do it by getting the socket location from the skeletal mesh of target actor

  • @viviancrompton1920
    @viviancrompton1920 3 года назад +1

    TLDW Double click lines to insert a reroute node. Thanks for the video. This is the only place I could find an explanation of how to do this after seeing several other videos where the author was inserting these with no explanation of how. It's not listed on the various blueprint "cheat sheets" that I looked at.

  • @FirstLast-pu9ty
    @FirstLast-pu9ty Год назад

    At 4:16 you have to use a Vector Get ABS node before getting the vector length otherwise it's using negative values and it ends up picking targets in the opposite direction.

  • @marleshasmith6069
    @marleshasmith6069 2 года назад +1

    how can i set the homing target to be whichever actor entered the trigger area 1st and then if that player leaves range, projectiles target whomever else in still in range
    (think Arena of Valor towers or Battleborn Towers)

    • @minusnine5036
      @minusnine5036 2 года назад

      Im having the same problem. Not really sure how to implement something like that

  • @Kenneth_Molotov
    @Kenneth_Molotov Год назад

    Hello i'm wondering how can you change the projectile into like a rocket or something, i'm kind of new to the scene

  • @osuketv8336
    @osuketv8336 Год назад

    when I lower down the closest distance variable and the bullet doesnt find anything to home to, it gives me an error. what should I do?

  • @ZXQ07
    @ZXQ07 3 года назад +2

    Hello Matt could you make a tutorial to how make aim assist like cod or if you already make can i have the link?

    • @MattAspland
      @MattAspland  3 года назад

      Hey, I have a video on auto-aim which might help you out :)
      ruclips.net/video/x2POW93wD24/видео.html

  • @cool9612
    @cool9612 3 года назад

    Can you do a Vhs Post processing effect

  • @nitrosurge5494
    @nitrosurge5494 3 года назад

    A genius in disguise

  • @begolu9907
    @begolu9907 3 года назад +2

    Hai sir,, could u make a tutorial multiple lock on target, thanks

    • @MattAspland
      @MattAspland  3 года назад

      Hey, I've made a video about an auto-aim lock on system which you might find helpful :)
      ruclips.net/video/x2POW93wD24/видео.html

  • @BreadincGames
    @BreadincGames 2 года назад

    Awesome! Thank you )))

  • @Cain532.
    @Cain532. Год назад

    How hard is it (or do you have a tutorial already) to track an existing projectile if it falls into a trigger volume? I want to build a way to track if a projectile goes into a trigger volume and toggles something like a door or whatever

  • @JoeHendersonOfficial
    @JoeHendersonOfficial Год назад +2

    i did everything correctly but its not working for me :(

  • @grifor5664
    @grifor5664 3 года назад

    Super! I love that you do some ''military-game'' stuff! continue this serie

  • @cocacola7535
    @cocacola7535 2 года назад

    How about moving targets?

  • @colinmoorhouse-r8s
    @colinmoorhouse-r8s Год назад

    I made this in the sense where it is trying to hit the player, and it always misses, but comes close. Any ideas on what I'm doing wrong?

  • @SamHall1995
    @SamHall1995 Год назад

    Thanks for the tutorial Matt, it works great for my gun but I'm trying to us the same blueprint for my AI when they shoot at me. But can't for the life of me figure out what i need to change to make this happen. Sorry I am a noob so this is probably dead simple but I just can't figure it out

  • @VeryNotAdamYCT
    @VeryNotAdamYCT 3 года назад +4

    First again

  • @coolboysentertainment5846
    @coolboysentertainment5846 2 года назад

    is there a way to do a homing on vector instead of scene compoenent XD

  • @dr.pgopakumar1213
    @dr.pgopakumar1213 3 года назад +1

    Hey man ur too awesome... Hey can u help me? Please upload a tutorial on how to make an object(a single object) spawn at random location when not looked at it... Please it would help me a lot.... Please

  • @minusnine5036
    @minusnine5036 2 года назад +1

    I'm getting an error after all the enemies have been destroyed. Its coming from the Return Node in the function. I guess since theres no more targets It doesnt know what to do.

  • @ferrerodev6574
    @ferrerodev6574 3 года назад +2

    Hi Matt. Great video.
    I want to ask a completly random question.
    Would you have any idea on how to make a physics-based grinding system for a skateboarding game?
    Been dreaming on how to do it for months. Thanks

    • @v8matey
      @v8matey 3 года назад +1

      ruclips.net/p/PLNTm9yU0zou7LqlU_LCLn5pa1516Z4_9W

  • @EstebanLopez-bn9pd
    @EstebanLopez-bn9pd Год назад

    I am running into an error when my projectiles destroy the target. They will not be able to recalculate the next target.

  • @DellAgarpo
    @DellAgarpo Год назад

    Followed everything you did to the letter from scratch, just two actors, target and projectile and it's not working, where am I going wrong?

  • @lordsombo
    @lordsombo Год назад

    If you already have an array of actors, you can simply get closest from the array node, instead of manually calculating the distance

  • @Preirin
    @Preirin 2 года назад +1

    Hey Matt - I'm using a particle emitter as part of my actor blueprint as it is a fantasy rpg spell. The spell locks on as it should just great, but doesn't curve to hit the target. It will fly past and then trigger the impact event. Any suggestions? Cheers

    • @megtwin
      @megtwin Год назад

      I'm trying the same thing with the same results.

  • @RagingGamingBear
    @RagingGamingBear 3 года назад +1

    Awesome tutorial! How would i go about making it so it can change targets based on a radius around my crosshair? If you know what i mean

    • @MattAspland
      @MattAspland  3 года назад +1

      Thanks man, you could maybe use a capsule trace going straight forward X units from where the player is looking. It is basically a linetrace, but 3D. Then set the homing target to be whatever, if anything, the trace collided with.
      That way it has to be within a certain radius from the crosshair (centre of player's screen/vision).
      Hope this helps and makes sense :)

  • @daha9546
    @daha9546 3 года назад +1

    how do I make sure it doesn't change the target after being shot first?
    I wouldn't like it to change course midair.

    • @Yggdrasil777
      @Yggdrasil777 2 года назад +1

      To do that, just don't have the loop on the begin play.

    • @daha9546
      @daha9546 2 года назад

      @@Yggdrasil777 Thanks!

  • @OnigoroshiZero
    @OnigoroshiZero 3 года назад +1

    For some reason the projectile goes to the enemy's feet and most times it hits the ground before reaching the target. I have disabled anything related to gravity in the projectile.
    If I have homing disabled, the projectile will go straight until it hits something as normal.

    • @ronmuller5376
      @ronmuller5376 3 года назад

      i Have the same issue. Could not figure out a solution yet

    • @developing4fun818
      @developing4fun818 3 года назад

      @@ronmuller5376 do you know now? Can you please tell me

    • @Yggdrasil777
      @Yggdrasil777 2 года назад

      Try raising the scene component so that it is not on the ground.

  • @rowcezarbrazil
    @rowcezarbrazil Год назад

    4:59 to be safer, you only need to set the 'closest Distance' at index 0, if index greater than zero, do the logic you created

  • @wesleyroberts4422
    @wesleyroberts4422 2 года назад +1

    Hello, I followed the tutorial, and it worked out okay. The only thing I'm having a problem with is when the homing projectile hits the target and the target moves to a new location, the homing projectile continuously keeps targeting the target's initial world location, instead of the target's new world location. How would I make the homing projectile target the target's new world location after it moves?

    • @ijerofei
      @ijerofei Год назад

      Hello! Did you found a solution?

  • @Peacemotiv
    @Peacemotiv 3 года назад

    I was trying to search a channel like code monkey but for ue4 and you are perfect choice
    BTW make a tutorial on touch controls like joy stick, hand icon appears when close to door etc.

  • @stealthgamesaremyjam145
    @stealthgamesaremyjam145 5 месяцев назад

    I'm trying to get the projectile to hit me but my projectile only goes to the location where I started the level. does anyone know if there is something I can do to have the projectile follow me?
    Edit:
    My pawn had a default scene root which would always stay in the same location when starting the level. I have dragged my Static mesh onto the default scene root and the projectile now follows me.

  • @JamalBakari
    @JamalBakari 3 года назад

    Great Video! I think you are missing the how-to make the BP target with the tag. Unless that is in a different video.

  • @SurviveOnlyStrong
    @SurviveOnlyStrong 2 года назад

    Great tutorial but it works weird because the change of direction is always the same in time for a small change as well as for the huge direction change.
    I mean if player jumps to the side the rocket should not turn in 180 degrees ( huge direction change ) in the same 1second as it's doing the minor direction change

    • @SurviveOnlyStrong
      @SurviveOnlyStrong 2 года назад

      found a way using manual set velocity: vinterp between current velocity and target velocity and when currentVelocity - targetVelocity length is > 100 set interp speed to 0.1
      This way when a rocket need to turn too much to the target it just stops turning.

  • @Devolius
    @Devolius 2 года назад

    Hey man, this is what I want for my game however, the projectiles stop when they reach their target. Normally that wouldn't be an issue, but I'm trying to make a vampire survivors style game, so I'd like the projectile to keep going in its last direction without the homing . Any help would be great!

    • @Luillopanto25
      @Luillopanto25 2 года назад

      Hey I am doing something similar. I am not home yet so I have not tried it, but I think what you can do is to put a "delay" node with a short amount of time, lets say "0.2" after finding the homing target location and then inmmedially setting the "is homing projectile" variable to false, so it will continue in that trayectory letting your target evade or escape your projectile. I have not tried it, but I think it should work.

  • @admalefrog4919
    @admalefrog4919 3 года назад

    Awesome tutorial! Btw, do you have any tutorials where you show how to grab objects HL2 style? Im not talking about gravity gun type of grabbing, just an item player grabing by pressing E?

  • @officialAfron
    @officialAfron 3 года назад

    Can you help me, when I have destroyed all my enemies and there are none left and I shoot another projectile, I get a runtime error after ending the simulation saying "Accessed None trying to read property Homing Target"
    it doesn't cause any gameplay issues but the error comes up after I end the simulation. how do I stop this coming up?

    • @ronmuller5376
      @ronmuller5376 3 года назад +1

      You can use a "Is Valid" on the homing target(No enemies mean that is "null"/empty), then a branch and add a returnnode empty. Then another branch, if homing target is empty, destroy actor.

    • @mononoke75
      @mononoke75 2 года назад

      @@ronmuller5376 I know this is a year out, but is there any way you could link a screen to how this validation works on this concept? I'm so close to complete implementation but am failing on where to placed the nodes here.

  • @RtxRob
    @RtxRob 3 года назад

    Hi, can you please do a thermal vision tutorial which can show fire and body heat in thermal ?
    I can share with you what I have done for thermal vision, I am not able to have the fire visibility in thermal.

    • @MattAspland
      @MattAspland  3 года назад +1

      Nice idea, I can add it to my list

    • @RtxRob
      @RtxRob 3 года назад

      @@MattAspland Please see what I have done so far
      ruclips.net/video/_0wpIfg4YUA/видео.html
      Files here
      drive.google.com/drive/folders/1MjA4RijSloZvd0_1z9kbMRGkcoC2WhyJ

  • @warfighter4129
    @warfighter4129 2 года назад

    I cant seem to get my projectile to lock on/change trajectory around my targets. I am not getting any errors, if someone has had a similar issue I would thankful to find a solution!

  • @6FingerGames
    @6FingerGames 2 года назад +3

    if you assign this logic to enemy and there is no more enemy on the map, it leads to error.
    this Logic is not useful for enemy. or for objects outside of value - in Float variable Closest Dinstance.
    Unfinished Blueprint. it works only for non destroyable objects on the map.

    • @Suthriel
      @Suthriel 2 года назад +3

      You can prevent that, if you a) give your projectile an ArrowComponent as backup target, that is just a little bit offset from the center / in front of the projectile, and then B) introduce a branch in the code (before it enters the loop), that checks, if the array of found actors has a lenght greater than Zero -> If true, it goes into the loop, and if false ( = zero targets found), then you assign that ArrowComponent as target. With that, it will chase that ArrowComponent (which will always be in front of the projectile, because it is part of the projectile blueprint), if no other target is found.

    • @DreamweaverGameStudio
      @DreamweaverGameStudio Год назад

      @@Suthriel how can i assign the arrow component as target?

    • @Suthriel
      @Suthriel Год назад +1

      @@DreamweaverGameStudio In my Homing Projectile Blueprint, where the ProjectileMovementComponent is, it´s as simple as dragging the ProjectileMovement Component into the Blueprint, then dragging a connection from it and serach for "Set Homing Target Component". That node accepts your Arrow component (and other components like Box Collision too).
      Not sure, if they have updated it (it works in my UE 4.27 version, aswell as in UE 5), so that it now can target other components too, not just Scene Components. In my Homing Projectiles, i either feed it the Arrow Component, if no valid Target exists, or the Box Collision Component from the found target (my chars use a box collision instead of a capsule, but that shouldn´t make any difference).

    • @DreamweaverGameStudio
      @DreamweaverGameStudio Год назад

      @@Suthriel Thank you for the kindness of helping, but I think I'm really bad at this. I tried to pull the length before the 'for each' loop with the condition of being less than 0 in the array, but the errors persist

    • @Suthriel
      @Suthriel Год назад +1

      @@DreamweaverGameStudio The condition for Lenght should be "equal to Zero" or "less or equal to zero". An array size of Zero is an empty array (no items =zero items in it), it can´t go into the negatives. An array with size one contains ONE item, and that one item has the Index Zero (the second item would have index One). Its slightly confusing, but the Lenght of an array is always one bigger than the Last index of an array.

  • @walney2008
    @walney2008 2 года назад

    hello, I have a third-person project, I am creating a helicopter, I would like to learn how to shoot with a machine gun and shoot with a missile, could you teach? I'm using this helium model (West_Heli_AH64D)

  • @elyaskhouja8634
    @elyaskhouja8634 2 года назад

    I tried to do this to my AI, but it didnt work His Vomit projectile just stayed going straight
    EDIT: I forgot to put the targeting speed, its fixed now.

  • @raktimjs
    @raktimjs 2 года назад

    Warzone UAV, LOL!

  • @ZXQ07
    @ZXQ07 3 года назад +2

    He