#Crosshair alignment with third person character (Bow and Arrow)

1 messages · Page 1 of 1 (latest)

wary summit
#

It’s still aligned, there’s just stuff in between the player character and your arrow’s target.
You need to first decide how you want to deal with that. You could do what fortnite does and just have a visual aid for when your character’s line of sight is blocked (more realistic)
or have the projectile pass through objects until it meets where your crosshair trace landed (will be able to pass through walls).
To minimize the need for either, make the camera closer up when drawing the bow.

sterile iris
#

Thanks for the info.
What do you mean there is stuff in between?
Any idea/tutorial I can see on making the camera closer to my character when drawing the bow? Still learning UE

wary summit
#

If you do the debug trace on Event Tick you’ll notice how there can be obstacles between your arrow socket and the target you actually want to hit. That’s what I meant by stuff in between.
As for the camera, if you have a Spring Arm component, you can shorten its Target Length when you press your designated Aim key. Not sure about a camera tutorial but shouldn’t be too hard to come across on youtube.

sterile iris
#

When I get an obstacle it turns the trace from red to green, this is not happening here. It really looks like the aim offset is not centered when firing from close range... I've tried in a clear map and I have the same problem

wary summit
#

Is the arrow being fired from the socket or the camera? Sorry I just noticed the trace is starting at the camera’s location so it won’t turn green.

sterile iris
#

It is firing from the socket

wary summit
#

Then you need to make the trace start from the socket location as well. Try that and you’ll have a more accurate trace, as well as see what exactly is blocking the arrow.

wary summit
sterile iris
#

I think that after the line trace I'm getting the socket location.
I like the camera closer up when drawing the bow, it is something I want to do in my project

wary summit
#

You can just connect the Location on the Break Transform node to the Trace Start and it will work.

sterile iris
#

Unfortunately it didn't work