Announcement

Collapse
No announcement yet.

How do I get end of a line trace by channel to match where my character is looking?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I get end of a line trace by channel to match where my character is looking?

    I am trying to make a fps game using a line trace by channel. I have managed to get the end location to match up with where I am facing along the X-axis, but I can't it to point up and down.

    #2
    You can use the following nodes to get the trace end location:

    Click image for larger version

Name:	fptrace.jpg
Views:	76
Size:	337.6 KB
ID:	1722106

    The camera forward vector gives you the direction that your character is looking at. By multiplying it with a large number like 10000 and then adding to the camera location, you get a very far away point in the direction that you're looking at. And this location can be used as the end point for your trace
    Unreal Possibilities
    Grid Creation Systems | Tower Defense Starter Kit | Line of Sight Visualization

    Comment


      #3
      Originally posted by Stormrage256 View Post
      You can use the following nodes to get the trace end location:

      Click image for larger version

Name:	fptrace.jpg
Views:	76
Size:	337.6 KB
ID:	1722106

      The camera forward vector gives you the direction that your character is looking at. By multiplying it with a large number like 10000 and then adding to the camera location, you get a very far away point in the direction that you're looking at. And this location can be used as the end point for your trace
      My character doesn't have a camera like that.
      Click image for larger version

Name:	Capture.PNG
Views:	82
Size:	14.8 KB
ID:	1722314

      Comment


        #4
        Originally posted by The Spygineer View Post
        My character doesn't have a camera like that.
        Click image for larger version

Name:	Capture.PNG
Views:	82
Size:	14.8 KB
ID:	1722314
        You can put one in.

        Comment


          #5
          Your camera is probably on the player controller ?

          Comment


            #6
            Originally posted by ClockworkOcean View Post

            You can put one in.
            How do I put one in?

            Comment


              #7
              You can click on the green "Add Component" button and add a Camera component from the dropdown menu. I'd suggest checking out the camera setup from the free First Person template.

              Click image for larger version

Name:	fpcam.jpg
Views:	78
Size:	416.7 KB
ID:	1722608
              Unreal Possibilities
              Grid Creation Systems | Tower Defense Starter Kit | Line of Sight Visualization

              Comment

              Working...
              X