Hi so I’m trying to correct my aim and I’ve finally after a week of struggle managed to get the bullet to hit it’s target. But I have another problem. And thats the rotation of my barrel. the barrel rotation is way of in comparision to the bullet line.
The black line is the current bullet path (ich) and as you see it doesn’t start of nice from the barrel but it hits its target
anyway I would prefer the blue line but since this is at a close range it’s not optimal to go for the high arc aim solution.
The best solution would be the red line but I don’t know why its aim is so of. I am using the low arc for my game and I’m not tracing in suggestprojectilevelocity.
Sorry I’ve have had some problems posting on this forum the last week don’t know why
Here you go, I have to mention tho that I’ve actually managed to get the right aiming direction aswell as bullet path for my projectile. But I stil have problems with my aim. The barrel either goes to high or to low in relation to it’s target. when aiming on the tank AI the aiming solution works fine, but when aiming at the landscape its another story.
I needed to rotate the projectile socket with the same elevation change as the barrel to get it to work. But as I said the aim is still of and I’m debugging at the moment, any tips may be helpful.
Yes it’s intentional since the Roll axis is up/down atleast in blueprint. In c++ I can get the elvation rotation from pitch but I need to pass it to the mesh as the Roll axis. Don’t know why but in a whole yes It’s intentional. I have managed to get the bullet to fly as intentional but it’s stil a aim problem regarding both the rotation of the barrel. Where the elevation is either to high or low.
Right! I totally forgot that I’ve could share my Github repo! It’s for the latest commit I’ve made so its up to dateGithub Repo:
Just remembered Ignore the Frotator Parameter TankRotation passing into AimAt (it were a try to correct the elevation angle when it worked even worse. But It’s not used so just ignore it for now).
Ok so I don’t have more time to continue debugging this today but in the meantime you could fix your orientation issues.
Unreal has positive X being the forward direction and your meshes aren’t facing that way, you can reimport them so they are facing the correct way, just change the import rotation settings and then use reimport, example gif:
Thank you so much @DanM by following your instructions, changing the elevation limitation values and some statement I got it to work as intended. And here’s my Github repo if someone may have the same problem/ made the same mistakes.