Download

Issues with line trace by channel

Hi,
I recently started working on a game and I just wanted to make a basic test level where the gun looks at a point in 3d space that I clicked. But I am having some issues with it so instead of writing an essay I just recorded a video outlining the problem. Here is the link: https://www.youtube.com/watch?v=OFMtpP7J6EU&feature=youtu.be
Thanks in advance everyone :smiley:

There are several possible issues that I see here -

The first one to look for is that you are only tracing 5000 units forward from the camera, yet you could click on a place in the world that is much farther with your mouse (messing up the end location of your trace).

If you want your turret to always rotate towards the mouse click location there is no need to even do a trace. Use Node “Covert Mouse Location To World Space” and use this vector on your Find Look At Rotation node. Then make sure you do Set World Rotation (Not Relative rotation) of your turret.

This video shows you how to use the node:
https://youtube.com/watch?v=b1_efR9hrT4

Hope this helps!

Hi,
thanks for the response! Increasing the trace distance did not help (I tried 100k) . I am not trying to make the turret look at where the mouse clicks, that is just so i can show my problem with the trace. My end goal is like this: Imagine a little X in the middle of the screen, I want my turret to aim at that point in 3d space. So for example if I am looking straight at a cube, I want the turret to face the cube.

wow! helpful for me