@@NebulaGamesInc Not sure. I'm still using UE4 for VR. But the method should work. Thing is, most people show a bunch of calculations, but figuring out how to impliment that into all the blueprint nodes is still a minefield. You cleared that, and made it look easy. Thanks again.
Could be many reasons. And this method isn't a "seeking" projectile. If you want something to chase the player look into homing projectiles. This just predicts where the player should be if continuing at the same speed in the same direction. I would need to know more of your set up to tell you what the issue might be
@@NebulaGamesInc i copied youre exact setup but the projectile always guesses too far in front of the player and misses if i hold the same velocity. also if i change directions the bullet misses again
If you change direction it will miss...it has not ability to change direction once the projectile is fired. If you want that you need a homing projectile. As for it missing in front of the player must be an issue with calculating the velocity of the player. You can probably add a fudge factor to increase the distance calculation.
This solved my issue with my enemies not shooting directly at the player. Now I just need to add an actual turret to the truck instead of rotating the whole model. Thank you!
I forget what that dinosaur looking head was called in the engine. Sorry, search for things like "point" or something. It's basically just a placeholder item you can use for reference points when creating meshes or characters so you can do things like I did instead of having firing attached to a specific mesh it can just be a point on 3D space
Finally! An explanation that doesn't take a degree in mathematics to understand lol. Many thanks my friend. I'm making a realistic space ship shooter and the ai kinda needs to be able to hit the player reliably. Lol
ruclips.net/video/g1CCGyVoHBQ/видео.html Check this out, I think I have a link to a patreon page where you can download the whole project, that's as far as I got with a space shooter. Might have some hidden gems in there for you to use/ reverse engineer
Thanks a lot, this still works in UE5. All I wanted was the final position so to make a leading indicator for the player in a space game like in Freelancer
Thank you! This helped me create the patroling tanks for my RTS defence game! Now tanks have aimbot lol, ofcourse I slowed down their rotation rate with interpolation so if something is moving too fast they are not able to hit it just like in reality
@@NebulaGamesInc Well I actually didn't expected that you would respond. By the way, can you make a tutorial about making AI characters or pawns smarter? I can create a basic AI but really struggle with making them smarter, just like knowing if the player is able to see them or not so the AI won't go to an open corner and think it's hidden. I actually have many things to learn but can't find any valid sources, the AI is the main one for me for now. Thanks for the predictive turret again tho, I couldn't find it anywhere else.
Unfortunately I have not been actively making tutorials lately as I don't have the time anymore. Also, I never really messed around with walking AI and utilizing the nav mesh and EQS system which is probably your best bet for the type of AI you want. I created AI for space games and those are a bit more complicated in the sense that nothing comes out of the box. So you have to create your own path finding and obstacle avoidance and target seeking behavior without the help of a nav mesh or EQS system to lean on. While some AI behaviors are common to all others are specific to your game and implementation. The best I can do is direct you to my patreon where you can find a free flying game template which comes with AI I created and see if any of that helps you. Good luck. Sorry can't be of more help.
@@NebulaGamesInc It's alright, there is actually a flying AI pathfinder addon in marketplace for free so I'm using that pathfinder for flying AIs, it's similar to a normal Nav Mesh. No problem on the tutorial part tho, this video already helped me a lot and I'm thankful of that.
Slowing down their ability to turn and aim is a really good idea for balance that I'm going to steal haha I'm currently making a 3D space ship shooter and the other thing I did was add a very slight randomness (about a range of 0.0001) to the Y and Z rotation of the spawned projectile to simulate the weapons having less than perfect accuracy. It makes the enemies less dangerous at long distances since the slight deviation becomes more apparent the further the projectile has to travel.
When projectile is too slow this method is not accurate enough. The solution is easy: you iterate the same calculate like 3 more times, and the result will be accurate enough
I am using a 2D sprite so instead of player ref > Tartet mesh I have Player Ref > Target Sprite but for some reason the sprite faces the opposite direction
@@xk498jf It has been a while since I made this but my goal was not to actually hit the player every time. I wanted it to be able to miss if the player changed trajectory or speed so that it would appear more like a person "trying" to shoot a moving target. I could have easily calculated the exact position of the player to ensure a hit but I didn't want that.
Step by step, I have implemented this tutorial but the turret is moving in random locations rather than targeting the player character. Can anybody kindly assist?
Sorry, these things can be very difficult to troubleshoot. Sometimes it's a small detail or connection missed. Even when making the tutorials things often go wrong and I had to pause the video while I put a bunch of print strings to figure out where the code was going wrong. Programming is like that, just keep working on it I'm sure you'll find the issue. I recommend breaking the code down piece by piece make sure each step works as expected before connecting it to the next line of coding logic.
Amazing.... 4 years ago, and still the best explanation of this on YT.
cheer, man.
Glad you like it....this still useful with UE5?
@@NebulaGamesInc Not sure. I'm still using UE4 for VR. But the method should work. Thing is, most people show a bunch of calculations, but figuring out how to impliment that into all the blueprint nodes is still a minefield. You cleared that, and made it look easy.
Thanks again.
Happy to hear man. Good luck with your project
This is still the best tutorial for this on the internet
Old tutorial but still fantastic. Thanks!
Only tutorial I could find that worked!! Awesome thanks
Happy to hear it
Hi there, this tutorial was fantastic and solved an issue many other tutorials glossed over. Thanks so much!
You're welcome!
@@NebulaGamesInc hi mate followed your setup but the projectiles still miss the target any ideas?
Could be many reasons. And this method isn't a "seeking" projectile. If you want something to chase the player look into homing projectiles. This just predicts where the player should be if continuing at the same speed in the same direction. I would need to know more of your set up to tell you what the issue might be
@@NebulaGamesInc i copied youre exact setup but the projectile always guesses too far in front of the player and misses if i hold the same velocity. also if i change directions the bullet misses again
If you change direction it will miss...it has not ability to change direction once the projectile is fired. If you want that you need a homing projectile. As for it missing in front of the player must be an issue with calculating the velocity of the player. You can probably add a fudge factor to increase the distance calculation.
Worked very easily! Thanks for the hard work.
Great to hear!
This solved my issue with my enemies not shooting directly at the player. Now I just need to add an actual turret to the truck instead of rotating the whole model. Thank you!
Happy to help!
This helped so much thank you very much for making this!
what is the firing point used n the video? im stuck there cuz i dont know how to add it in. nvm. fuked around and found out. all good
I forget what that dinosaur looking head was called in the engine. Sorry, search for things like "point" or something. It's basically just a placeholder item you can use for reference points when creating meshes or characters so you can do things like I did instead of having firing attached to a specific mesh it can just be a point on 3D space
Finally! An explanation that doesn't take a degree in mathematics to understand lol. Many thanks my friend. I'm making a realistic space ship shooter and the ai kinda needs to be able to hit the player reliably. Lol
ruclips.net/video/g1CCGyVoHBQ/видео.html
Check this out, I think I have a link to a patreon page where you can download the whole project, that's as far as I got with a space shooter. Might have some hidden gems in there for you to use/ reverse engineer
@@NebulaGamesInc what a legend! I'm trying to get a demo up before the end of the week for a game jam so this is greatly appreciated.
Thanks a lot, this still works in UE5. All I wanted was the final position so to make a leading indicator for the player in a space game like in Freelancer
Glad it is still functional all these years later. So crude though...ha
@@NebulaGamesInc My space game has come a long way
@@finesseandstyle Post a link here so we can see your progress!
@@NebulaGamesInc it got deleted
@@finesseandstyle RUclips does that sometimes. You can email me I'll post it for you if you want.
This is great
THANKS!!
Amazing, great stuff, worked first try :)
Happy to hear it!
great video! thanks for the help!
Happy to help 🙂
Great tutorial, helped me big time!!!!
Glad it was useful!
simply genius, thank you for sharing it.
Glad you found it helpful 🙂
Very easy solution, thanks for your time :)
Happy to help man 🙂
thank you so much!
Thank you!
This helped me create the patroling tanks for my RTS defence game!
Now tanks have aimbot lol, ofcourse I slowed down their rotation rate with interpolation so if something is moving too fast they are not able to hit it just like in reality
Happy to help!
@@NebulaGamesInc Well I actually didn't expected that you would respond. By the way, can you make a tutorial about making AI characters or pawns smarter? I can create a basic AI but really struggle with making them smarter, just like knowing if the player is able to see them or not so the AI won't go to an open corner and think it's hidden.
I actually have many things to learn but can't find any valid sources, the AI is the main one for me for now.
Thanks for the predictive turret again tho, I couldn't find it anywhere else.
Unfortunately I have not been actively making tutorials lately as I don't have the time anymore. Also, I never really messed around with walking AI and utilizing the nav mesh and EQS system which is probably your best bet for the type of AI you want. I created AI for space games and those are a bit more complicated in the sense that nothing comes out of the box. So you have to create your own path finding and obstacle avoidance and target seeking behavior without the help of a nav mesh or EQS system to lean on. While some AI behaviors are common to all others are specific to your game and implementation. The best I can do is direct you to my patreon where you can find a free flying game template which comes with AI I created and see if any of that helps you. Good luck. Sorry can't be of more help.
@@NebulaGamesInc It's alright, there is actually a flying AI pathfinder addon in marketplace for free so I'm using that pathfinder for flying AIs, it's similar to a normal Nav Mesh.
No problem on the tutorial part tho, this video already helped me a lot and I'm thankful of that.
Slowing down their ability to turn and aim is a really good idea for balance that I'm going to steal haha I'm currently making a 3D space ship shooter and the other thing I did was add a very slight randomness (about a range of 0.0001) to the Y and Z rotation of the spawned projectile to simulate the weapons having less than perfect accuracy. It makes the enemies less dangerous at long distances since the slight deviation becomes more apparent the further the projectile has to travel.
When projectile is too slow this method is not accurate enough. The solution is easy: you iterate the same calculate like 3 more times, and the result will be accurate enough
hey nice video I was wondering if you could help my AI is facing the wrong way when shooting
Check the actor hierarchy, see what you're actually rotating and where the mesh is located in that hierarchy in the viewport. Could be the issue.
I am using a 2D sprite so instead of player ref > Tartet mesh I have Player Ref > Target Sprite but for some reason the sprite faces the opposite direction
@@NebulaGamesInc Thank you found a fix I rotated Actor in the viewport 180 on the Z
Hello! How can I reduce the range? Thank you in advance for your answer!
problem here is that the bullet travel time is set using the player's current location rather than the predicted location it will be traveling to.
@@xk498jf It has been a while since I made this but my goal was not to actually hit the player every time. I wanted it to be able to miss if the player changed trajectory or speed so that it would appear more like a person "trying" to shoot a moving target. I could have easily calculated the exact position of the player to ensure a hit but I didn't want that.
Step by step, I have implemented this tutorial but the turret is moving in random locations rather than targeting the player character. Can anybody kindly assist?
SetActorRotation gives errors for me "found none"
You mean "accessed none"?
@@NebulaGamesInc I mean "found none"
Not sure what that error is. Don't recall ever seeing it before.
idfk why this is not working for me...
Sorry, these things can be very difficult to troubleshoot. Sometimes it's a small detail or connection missed. Even when making the tutorials things often go wrong and I had to pause the video while I put a bunch of print strings to figure out where the code was going wrong. Programming is like that, just keep working on it I'm sure you'll find the issue. I recommend breaking the code down piece by piece make sure each step works as expected before connecting it to the next line of coding logic.
My guy doesnt even spawn the bullet :D
🤷♂️
oy vey