Game Development Community

Weapon projectile/ crosshair accuracy

by Ronald J Nelson · in Torque Game Engine · 05/09/2008 (8:06 pm) · 7 replies

Where do you make adjustments for the crosshair and projectile direction accuracy? Basically my crosshairs are off.

#1
05/09/2008 (10:04 pm)
The problem is more than likely with your projectile. Check this before ya go a dig around in the hud gui.

Find this line in your weapon.cs;

datablock ShapeBaseImageData(yourweaponnamehere)

within that datablock is this line;

correctMuzzleVector = true;

Make SURE it says TRUE....sometimes it gets set to false.

I found this little tidbit out because I had the same issue and setting the value to true fixed it. If not then you may have moved your crosshair GUI. Try the above first though.
Hope that helps.
#2
05/10/2008 (9:52 pm)
Thanks Ron, but neither of those were the issue.
#3
05/11/2008 (12:42 am)
I understand what Ron is saying, make a whole new game and put the crosshair and a mirror in there, then stand right infront and center of the mirror and walk backwards keeping crosshair in the center, your character will move off the side of the mirror. It is as if the camera, HuD, and whatever else are involved are not ligned up properly.
#4
05/11/2008 (3:04 pm)
Rich hit the nail right on the head. I occasionally get perfect accuracy but the crosshair will be off after I move around a bit more.
#5
05/12/2008 (10:29 pm)
OK now that it is established that I am not the only one that sees this problem, has anyone managed to solve it?
#6
05/13/2008 (1:12 am)
Make sure you're camera/eye node is perfectly aligned in your model. The current implementation of the crosshair has nothing to do with the aiming really. The Crosshair is simple a bitmap in the middle of the screen.

For perfect firing you will need to adjust your muzzlevector in our ShapeImage::onFire() function. The projectile not firing at exactly where the crosshair is is much more noticable in 3rd person mode. I have a post about what I've done somewhere in the forums (www.garagegames.com/mg/forums/result.thread.php?qt=74940). You can do exactly the same thing. I hope I'm understanding your problem.
#7
05/13/2008 (4:43 am)
Thanks James.