Line trace from character towards the mouse location in a 3D space

Hey UE4 users :smiley:

I’m currently using the 3rd person template and I’m trying to trace a line from my character to the mouse position in a 3D space but I’m stuck because I can’t seem to be able to get the X, Y and Z of the mouse in a 3D space.

I’ve tried a few options with the ConvertMouseLocationToWorldSpace node but they only work for a sidescroller game(2D).

Do you have any ideas about how I could achieve this?

I’ve tried a few options with the
ConvertMouseLocationToWorldSpace node
but they only work for a sidescroller
game(2D).

It should work for everything. Generally speaking, it’s this:

Not accounting for world collision since you did not mention any.

Hey, thx for taking the time to help me. I took a break and went for some fresh air, came back to the simplest solution I could think of, and it kinda works. I’m thinking of actually showing how I did it so maybe others who struggle with this will have an idea. Also, I’m kinda new to this, should I mark it as solved or should I delete it?

There’s usually more than one solution to each problem, don’t delete it. Someone will find it useful one day.

Good luck with the rest.