I was wondering if anyone had any info on how to lower a crosshair and still line trace correctly.
Do you mean draw the CH lower on the screen?
It seems the tracing from the camera is based on the center of the screen and when you place the crosshair in the middle everything should be accurate. Now if I move the reticle down to be lower then the shots will not align with the crosshair. This method is used by some games and I do like it more than the center even though some people might think otherwise the game could have both anyway.
Ok, so you can start the line trace at a point X lower than the camera center. X is the distance you have lowered the CH. Does that work?
Oh wait I have never done before any weapon shooting and I thought the line trace for projectiles was always in the center and obviously never thought you could make your own tracing from anywhere.
Never seen anyone doing this so I was just thinking it could be something more complex to achieve so I asked prior to do some tests. I guess most people don’t want to change the crosshair position off-center.
You have to make your own trace code, so you can do it from where you want
Yeah I guess it is as simple as that. What a silly question, right?
Not silly. It’s just unclear.
Now if I move the reticle down to be lower then the shots will not align with the crosshair.
Perhaps you’re assuming that the 2d crosshair has something to do with 3d tracing. These 2 entities know nothing about each another, the crosshair is just a fake visualisation of where we’re hoping the trace is going… (it’s also badly offset by 8px in the first person template)
So this happens to be the centre of the screen because we’re using a forward vector (of the gun to which the camera is attached!) to aim . So it’s a sheer coincidence these 2 align…
move the reticle down
Down is arbitrary in 3d. How are we shooting:
When you look at 99% of the shooters, it makes no sense whatsoever:
Where the heck are those bullets flying? It’s somewhat easier to justify if the gun is centred; still, gets weirder the longer you think about it. According to this, I will not blow my face off:
The best examples are games that use hardcore mode where there is no aiming reticle. You still aim with the centre of the screen because that is natural - here you can cheat and put a sticker in the middle of the screen.
One somewhat graceful way of doing it is to deproject the location of the trace hit and paint the crosshair there. Think laser beam minus the actual laser.
Could you provide an example of how you envisioned it to work?
- are we going to fire physical bullets
- are we just tracing and damaging the target and the bullets are fake?
- are we firing beam weapons
Thanks man. Yeah I know the reticle is just a visual feedback or cosmetic. For some reason I thought I was missing something when I saw this Halo talk about the lower reticle they used and well I have played Hunt Showdown for too many hours and I really love that game. You can refer to those 2 titles. It seems the weapon aligns perfectly the way they have it.
Cool example of faking it enough to make it look about right. Try this:
The camera is looking along the yellow, but we’re rotating it by 10 degrees (exaggerated to demo, 5 would work better at 10k distance) and then project it along the new vector for 10000 uus, we then take that location and deproject it back to screen space. We also use it for tracing.
A simple 32x32px widget represents the crosshair. Since I’m updating the widget on tick, I had to:
This can handled more gracefully.
The red one is the original, the darker one is our rotated vector deprojected back to screen. Trace hits that spot - that’s what’d you use to detect hits.
You may need to experiment with the values a bit, namely the length of the trace and the angle. Depending on how the guns are modelled and animated, it may not always look right. But then each gun can have its own offset for the reticle.
It seems it wasn’t as simple as I thought at least for someone that has no much experience. I am testing now and actually seeing that if you try to make it work with an arrow to be used as tracing point attached to the camera and simply moving the arrow down doesn’t work. Does doing that even make sense? I am quite illiterate when it comes to math.
Also, why is the FP template crosshair off-center? I read yesterday that was the case but after testing your tracing, the regular crosshair is way off.
Ok I just read the reason which is was that the crosshair texture size wasn’t taken into account. Funny this is still wrong in the template after so long.
I guess it does not matter much, the template fires gravity affected projectile blobs - it does not matter where you aim, you can’t shoot straight anyway.
It is definitely not important. Thanks again.
It’s a size box with an image inside:
The player adds it to the screen:
If you have an issue replicating what I’ve posted, do tell. Happy to push the zipped project your way if that helps. So you can you play around with the values and get the feel of what works for you and what does not.
Yeah I was figuring things out as I asked but thanks for making it more clear.
Hey no worries no need to send anything it seems when I did some undo I changed the tick group back to default. That’s why my crosshair was going off.
Yeah, it will wobble because of tick group order.