I’m currently trying to make a fps game that is heavily inspired by the original DOOM game.
Due to limitations at the time, the player character was only able to look left and right, therefore vertical aiming was done by some kind of aim assist.
I’m wondering if anyone has any clue how to implement this into ue4.
I thought that firing raycasts from the camera to fill the screen vertically would work, however it has some limitations (and performance issues).
If anyone could give me some suggestions it would be much appreciated!
An option could be: have a cone shaped component that picks up and drops overlapping actors in auto-aim range. Check them from closest to farthest, then go through that list until you get to one that’s within the center range of the screen, and finally check for line of sight.
If I miss understood pardon! hard read that ugly link
*** Doom like aim in 35 new wires or less ***
The EnemyBox of EnrealDoom is 100% irrelevant any BP or AI will work as is
Keep’n it Unreal don’t break the experience nothing* else has to change
Todo/Homework*:
Integrate chest/head height offset for aim system
Limit Up/Dn Angle of shot, shoot forward if too great or Pitch arms/weapon with Pitch of shot
lol - come here you sob I’m gonna drop a box on you
(sorry overlapping audio)
Feel free to ask if you have any questions the math is sound and no hacks needed the modifications here are in one function of the template, the fire projectile graph portion I made one function that gets the best enemy to pitch on and duplicated a portion of flow based on valid/invalid.
It had a good feel to me BP was running it smooth and if the enemy is spaced out it may be fine with little more culling for a big level and with a enemy base class you don’t have to cast to get info we need and you could do switch’s/buttons based on the enemy base class and never have to change the code but we would have to change to get all actors with tag instead of class and the info we need would still be Actor level and also still no cast will be needed keeping it fast.
I think I’ve managed to find a solution, at least for now.
For anyone interested, I’ve left a screenshot below.
It just fires off a bunch of spheretraces along the vertical axis and then adds any hit actors into an array which can then be used to find the nearest target.
Thank you to anyone that helped!
If anyone has any more suggestions for optimisation it would be much appreciated as I feel like eventually it could cause some performance issues.