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.
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
@@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!
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.
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.
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?
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.
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.
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.
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)
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
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
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
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.
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
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
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 :)
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.
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?
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.
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.
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
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.
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!
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.
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?
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?
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.
@@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.
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 Please see what I have done so far ruclips.net/video/_0wpIfg4YUA/видео.html Files here drive.google.com/drive/folders/1MjA4RijSloZvd0_1z9kbMRGkcoC2WhyJ
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!
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.
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 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).
@@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
@@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.
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)
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.
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.
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
YES B.A.B.Y !
@@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!
@@Doubleaa500 Thanks for the info!
@@megtwin No problem!! I hope that helped!!
you know, you did in 11 minutes what other tutorials do in 1.5 hours. Thank you for being concise!
My pleasure!
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.
I'm not fully understanding your description, would it be possible to explain in more detail (I know it's been a while)
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.
took me 3 days.. but this is the tutorial that worked. Thank you!
Glad it helped!
I swear you're the best UE4 tutor when it comes to blueprints 🥺
This is exactly what I needed, thank you so much!!
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.
Only ue4 channel I watch for fun and learning. Thank you.
So nice tut. The best ue4 developer of yt
A pleasure to help! :)
It is the best UE tutorial videos I've ever seen
What a video absolutely amazing great video . Thanks for making these helping video
Thank you so much! Always happy to help :)
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?
Thank you and leared a lot just now too.
Thank you man, This really helped
NICE!!!
Super tutorial. Amazing how you keep coming up with great content.
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?
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
Great video, Think this could updated ue5? could not get this working
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.
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.
Yes you can do it by getting the socket location from the skeletal mesh of target actor
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.
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.
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)
Im having the same problem. Not really sure how to implement something like that
Hello i'm wondering how can you change the projectile into like a rocket or something, i'm kind of new to the scene
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?
Hello Matt could you make a tutorial to how make aim assist like cod or if you already make can i have the link?
Hey, I have a video on auto-aim which might help you out :)
ruclips.net/video/x2POW93wD24/видео.html
Can you do a Vhs Post processing effect
A genius in disguise
Hai sir,, could u make a tutorial multiple lock on target, thanks
Hey, I've made a video about an auto-aim lock on system which you might find helpful :)
ruclips.net/video/x2POW93wD24/видео.html
Awesome! Thank you )))
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
i did everything correctly but its not working for me :(
Super! I love that you do some ''military-game'' stuff! continue this serie
How about moving targets?
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?
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
First again
is there a way to do a homing on vector instead of scene compoenent XD
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
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.
use a is valid node
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
ruclips.net/p/PLNTm9yU0zou7LqlU_LCLn5pa1516Z4_9W
I am running into an error when my projectiles destroy the target. They will not be able to recalculate the next target.
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?
If you already have an array of actors, you can simply get closest from the array node, instead of manually calculating the distance
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
I'm trying the same thing with the same results.
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
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 :)
how do I make sure it doesn't change the target after being shot first?
I wouldn't like it to change course midair.
To do that, just don't have the loop on the begin play.
@@Yggdrasil777 Thanks!
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.
i Have the same issue. Could not figure out a solution yet
@@ronmuller5376 do you know now? Can you please tell me
Try raising the scene component so that it is not on the ground.
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
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?
Hello! Did you found a solution?
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.
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.
Great Video! I think you are missing the how-to make the BP target with the tag. Unless that is in a different video.
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
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.
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!
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.
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?
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?
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.
@@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.
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.
Nice idea, I can add it to my list
@@MattAspland Please see what I have done so far
ruclips.net/video/_0wpIfg4YUA/видео.html
Files here
drive.google.com/drive/folders/1MjA4RijSloZvd0_1z9kbMRGkcoC2WhyJ
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!
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.
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.
@@Suthriel how can i assign the arrow component as target?
@@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).
@@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
@@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.
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)
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.
Warzone UAV, LOL!
He