How To Create A Homing Projectile - Unreal Engine Tutorial

  Рет қаралды 37,539

Matt Aspland

Matt Aspland

Күн бұрын

Hey guys, in today's video, I'm going to be showing you how to set up a homing projectile and/or missile for your game. This can lock on to any target you like, and it can also update targets while moving.
#Ue4 #UnrealEngine4 #Ue4Tutorial
___________________________________________________________________________
00:00 - Intro
00:29 - Overview
01:08 - Setting Up
02:32 - Finding The Homing Target
06:30 - Locking Onto The Target
09:10 - Updating The Target
10:11 - Specifying Homing Targets
10:52 - Final Overview
11:40 - Outro
___________________________________________________________________________
My Public Video List: trello.com/b/7vJgXzBm
My Patreon Page: / mattaspland
Unreal Engine 4 Tutorials Playlist: • Unreal Engine 4 Tutorials
The Basics Of Nodes Playlist: • The Basics Of Nodes In...
Blender Tutorials Playlist: • Blender Tutorials
___________________________________________________________________________
If you enjoy make sure to subscribe: / @mattaspland
Join My Discord Server: / discord
Follow Me On Instagram: / matt_aspland_
All My Social Media Links: linktr.ee/MattAspland
___________________________________________________________________________
If you want to support me, you can PayPal me at "matt.aspland.1@gmail.com". This is by no means expected or required. It is just a nice support :)
My Patreon Page: / mattaspland
Link to PayPal: www.paypal.com/
You can also support me on Ko-Fi following this link: ko-fi.com/mattaspland
Thank you :)
___________________________________________________________________________
♫Music By♫
●Kronicle - Chill Noons
●Soundcloud - / the-chemist-10

Пікірлер: 100
@MDLuffy1234YT
@MDLuffy1234YT Жыл бұрын
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 Жыл бұрын
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 3 ай бұрын
YES B.A.B.Y !
@Chooch_The_Dog
@Chooch_The_Dog Жыл бұрын
you know, you did in 11 minutes what other tutorials do in 1.5 hours. Thank you for being concise!
@MattAspland
@MattAspland Жыл бұрын
My pleasure!
@user-yuri665
@user-yuri665 2 жыл бұрын
I swear you're the best UE4 tutor when it comes to blueprints 🥺
@stevewynn4612
@stevewynn4612 2 жыл бұрын
Super tutorial. Amazing how you keep coming up with great content.
@happy-oni9240
@happy-oni9240 2 жыл бұрын
Only ue4 channel I watch for fun and learning. Thank you.
@grifor5664
@grifor5664 2 жыл бұрын
Super! I love that you do some ''military-game'' stuff! continue this serie
@davidabruzzo7327
@davidabruzzo7327 8 ай бұрын
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.
@noisyether9211
@noisyether9211 2 жыл бұрын
Thank you and leared a lot just now too.
@user-ns6xu8yn6v
@user-ns6xu8yn6v 2 жыл бұрын
It is the best UE tutorial videos I've ever seen
@neosinan1
@neosinan1 8 ай бұрын
Thank you man, This really helped
@stormrungaming
@stormrungaming Жыл бұрын
took me 3 days.. but this is the tutorial that worked. Thank you!
@MattAspland
@MattAspland Жыл бұрын
Glad it helped!
@BreadincGames
@BreadincGames 2 жыл бұрын
Awesome! Thank you )))
@abdullahsohail5395
@abdullahsohail5395 2 жыл бұрын
What a video absolutely amazing great video . Thanks for making these helping video
@MattAspland
@MattAspland 2 жыл бұрын
Thank you so much! Always happy to help :)
@Faizy_Writes
@Faizy_Writes 2 жыл бұрын
NICE!!!
@viviancrompton1920
@viviancrompton1920 2 жыл бұрын
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.
@Kieza-
@Kieza- 7 ай бұрын
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 16 күн бұрын
I'm not fully understanding your description, would it be possible to explain in more detail (I know it's been a while)
@admalefrog4919
@admalefrog4919 2 жыл бұрын
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?
@Peacemotiv
@Peacemotiv 2 жыл бұрын
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.
@ignacio-sanchez4646
@ignacio-sanchez4646 2 жыл бұрын
So nice tut. The best ue4 developer of yt
@MattAspland
@MattAspland 2 жыл бұрын
A pleasure to help! :)
@Phoenix_VR
@Phoenix_VR 2 жыл бұрын
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?
@nitrosurge5494
@nitrosurge5494 2 жыл бұрын
A genius in disguise
@jephrennaicker4584
@jephrennaicker4584 10 ай бұрын
Great video, Think this could updated ue5? could not get this working
@JamalBakari
@JamalBakari 2 жыл бұрын
Great Video! I think you are missing the how-to make the BP target with the tag. Unless that is in a different video.
@bungobilbo5709
@bungobilbo5709 16 күн бұрын
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.
@VeryNotAdamYCT
@VeryNotAdamYCT 2 жыл бұрын
First again
@noisyether9211
@noisyether9211 7 ай бұрын
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.
@dr.pgopakumar1213
@dr.pgopakumar1213 2 жыл бұрын
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
@ferrerodev6574
@ferrerodev6574 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 2 жыл бұрын
kzfaq.info/sun/PLNTm9yU0zou7LqlU_LCLn5pa1516Z4_9W
@Ausyaustingaming
@Ausyaustingaming Жыл бұрын
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
@SamHall1995
@SamHall1995 8 ай бұрын
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
@RagingGamingBear
@RagingGamingBear 2 жыл бұрын
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 2 жыл бұрын
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 :)
@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
@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.
@xelusprime
@xelusprime 7 ай бұрын
Can you make a guided rocket using this homing functionality?
@Galvatorrix
@Galvatorrix Жыл бұрын
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?
@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
@cool9612
@cool9612 2 жыл бұрын
Can you do a Vhs Post processing effect
@user-yl7zj7tz5y
@user-yl7zj7tz5y Жыл бұрын
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?
@AzaGorod
@AzaGorod 2 жыл бұрын
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.
@user-sv4nq8vq1s
@user-sv4nq8vq1s 2 жыл бұрын
Yes you can do it by getting the socket location from the skeletal mesh of target actor
@marleshasmith6069
@marleshasmith6069 2 жыл бұрын
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
@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
@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?
@Preirin
@Preirin Жыл бұрын
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.
@ZXQ07
@ZXQ07 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 2 жыл бұрын
Hey, I have a video on auto-aim which might help you out :) kzfaq.info/get/bejne/rpiAgrpqmN2oYmg.html
@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!
@cocacola7535
@cocacola7535 2 жыл бұрын
How about moving targets?
@coolboysentertainment5846
@coolboysentertainment5846 2 жыл бұрын
is there a way to do a homing on vector instead of scene compoenent XD
@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.
@stealthgamesaremyjam145
@stealthgamesaremyjam145 Ай бұрын
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.
@RtxRob
@RtxRob 2 жыл бұрын
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 2 жыл бұрын
Nice idea, I can add it to my list
@RtxRob
@RtxRob 2 жыл бұрын
@@MattAspland Please see what I have done so far kzfaq.info/get/bejne/lZano6yXzJq9hXU.html Files here drive.google.com/drive/folders/1MjA4RijSloZvd0_1z9kbMRGkcoC2WhyJ
@JoeHendersonOfficial
@JoeHendersonOfficial Жыл бұрын
i did everything correctly but its not working for me :(
@begolu9907
@begolu9907 2 жыл бұрын
Hai sir,, could u make a tutorial multiple lock on target, thanks
@MattAspland
@MattAspland 2 жыл бұрын
Hey, I've made a video about an auto-aim lock on system which you might find helpful :) kzfaq.info/get/bejne/rpiAgrpqmN2oYmg.html
@wesleyroberts4422
@wesleyroberts4422 Жыл бұрын
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?
@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.
@minusnine5036
@minusnine5036 2 жыл бұрын
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.
@LeonelAmaral14
@LeonelAmaral14 Жыл бұрын
use a is valid node
@OnigoroshiZero
@OnigoroshiZero 2 жыл бұрын
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 2 жыл бұрын
i Have the same issue. Could not figure out a solution yet
@developing4fun818
@developing4fun818 2 жыл бұрын
@@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.
@daha9546
@daha9546 2 жыл бұрын
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 жыл бұрын
To do that, just don't have the loop on the begin play.
@daha9546
@daha9546 2 жыл бұрын
@@Yggdrasil777 Thanks!
@EstebanLopez-bn9pd
@EstebanLopez-bn9pd 9 ай бұрын
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?
@walney2008
@walney2008 Жыл бұрын
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)
@officialAfron
@officialAfron 2 жыл бұрын
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 2 жыл бұрын
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 Жыл бұрын
@@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.
@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
@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!
@6FingerGames
@6FingerGames 2 жыл бұрын
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 Жыл бұрын
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.
@Hyraxonable
@Hyraxonable Жыл бұрын
@@Suthriel how can i assign the arrow component as target?
@Suthriel
@Suthriel Жыл бұрын
@@Hyraxonable 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).
@Hyraxonable
@Hyraxonable Жыл бұрын
@@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 Жыл бұрын
@@Hyraxonable 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.
@ZXQ07
@ZXQ07 2 жыл бұрын
He
How To Make A Basic Quick Turn - Unreal Engine Tutorial
7:53
Matt Aspland
Рет қаралды 7 М.
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 26 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 55 МЛН
I Turned Fake Mobile Game Ad into a Real Game
10:26
Fat Dino
Рет қаралды 3,5 МЛН
3 Devs Make An FPS - Godot vs Unity vs Unreal || GameDev Battles
12:39
Learning Unreal Engine in One Month to make a Game!
15:25
Will Hess
Рет қаралды 66 М.
How to Create a Map EXTREMELY FAST in UE5
9:55
Evans Bohl
Рет қаралды 150 М.
How I Remade MW2 with Unreal Engine 5
12:37
reubs
Рет қаралды 3 МЛН
Fire homing projectiles (Bite sized) - Unreal Engine 5
7:51
LeafBranchGames
Рет қаралды 5 М.
How To Draw A Line Trace With Bullet Drop - Unreal Engine 5.4 Tutorial
24:28
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 2,5 М.
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 622 М.