Linetrace offset from crosshair... what am i missing? xD

Trying to do traces from charater position to the crosshair so i can select objects, but im with this offset problem ¬¬
cfe311a02f198ebc7524b673ab8f95e827b50d24.jpeg

Don’t bother adding the base eye height?
I other than that it looks right .

Get player camera manager, then get it’s location. Rather than just using the player location. Then remove the eye offset.

Ah yes, that’s it… Camera instead of player.

I don´t have a camera in my character blueprint, do i need to create one? how do i setup to use it?

Wierd, after using some crasy values like 100000 on the forward vector multiplyer it stoped offseting ¬¬

It seems like an odd way of doing it. Here’s the method I always used.

I have mine in a function and it goes like this

47bc752205af8c3bda8c29e3f5e27d54d200aa42.jpeg

I’ve commented most of it but that branch is there so when you’re not looking at something it empties the targeted actor variable.

Worked fine, thx … this way how do i set how far the trace goes?

Not sure i´v understanded how it works, but it worked just fine xD thx leonn3K

The vector fed into the Rotate Vector node. Or more specifically I just left it without connecting a make vector node. It’s basically a X512 Y0 Z0 vector because +X is almost always considered “Forward”. You could hook up a Make Vector like Leon did and plug in any value on X.

The easiest way do do that is to use the node ‘Get Forward Vector’ I think, you just need to multiply to a value you want for the distance to how far the line goes :).

28966f4f6980efb44da02ea52f375a62e8012da7.jpeg

A tidbit about Line-Tracing by Channel from the camera which solved a problem I had where certain objects were ignored for no apparent reason:

"Camera - Exactly the same as Visibility, but should be used for setting when tracing from the camera. "
source:https://docs.unrealengine.com/latest/INT/Engine/Physics/Collision/index.html

Thanks! I haven’t noticed any problems but I may as well change it to that :slight_smile: