- Home /
Getting angle where viewport intersects trigger
What Im trying to do is get the angle around the y axis at which my viewport intersects a trigger when I jump. My first attempt was to find where on the x axis laid a point that did so using math but I cant get the angle between my viewpoint and parallel to the trigger. Now Im trying to affix a primitive object to my viewport (either a plane [preferable] or a cube) and then find where it collides with the trigger and use those co-ordinates. Apparently childing an object to my player character means that object is suddenly incapable of collision though. I can still use it as a moving trigger but as far as I know that wont give me the co-ordinates of the collision so Im kinda at a loss at the moment. Any help with anything related would be much appreciated.
By 'viewport' are you talking about the camera plane?
Are you using box colliders for your triggers, or something more complex?
And what is the reference for your angle? Rotation of the trigger object? The normal of the surface hit?
A drawing or screen shot might help here.
I do mean the camera when I talk about the viewport. The triggers are only using box colliders. Im not sure what you mean by the reference for my angle.
I'm still not getting your base problem. Sorry. You can Raycast the forward of your camera to find the hit point on the box collider.