red is unreals trace.
yellow is my indication how far it should go.
Green is the target “line” the rays should extend to.
What I am trying to accomplish is basically my line trace projecting back to the orthogonal of the vector between the player and the object. It should shoot rays as far as the green plane. I am using the dot product and I am not sure where I am going wrong. If anyone has a solution it would be greatly appreciated!
I would try putting everything on the click event for starters. At the moment, there’s no guarantee what you’re getting from tick is synchronized with the other stuff.
I’m not familiar with line plane intersection so I’m not sure if that’s what you want, but here’s how to do it using trig
Effectively all we do is divide distance by cos(theta), theta being the angle delta between the axis and player rotations. For Y we have to subtract 90.
I want to shoot rays from cam and it should go into the direction until its perfectly orthogonal between the red vector and not past that.
like so. However may rays seem to be too short. I notice that the rays I fire are orthogonal to the target however what I want to ensure is that the rays going from p to fired ray and ray to cam are orthogonal, not the fired ray to the point p