Announcement

Collapse
No announcement yet.

Linetrace. Rotate forward vector.

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

    Linetrace. Rotate forward vector.

    Hi guys

    How we can rotate linetrace sended from capsule side by angle alpha as in picture?

    Click image for larger version

Name:	aaa.PNG
Views:	120
Size:	117.4 KB
ID:	1647069

    Trace are sended from little green sphere on capsule side.
    Cause i need rotate trace up and down by some alpha value, my naive approach was: rotatevector and put my alpha value to Y input. That doesnt work, cause trace will move up/down when capsule will rotate.

    #2
    Alexander.L Are these objects in a BP? Then just don't connect the green dot component to the capsule component ( so when the capsule rotates, the green dot does not ).

    Otherwise you'll need to find then endpoint of the trace using getforwardvector and multiple by the length ( as in the many youtube tutorials ).

    Comment


      #3
      I do not know if it helps you but I do something similar in a function. remove the part where I randomize the accuracy and use only the pitch (alpha in degrees). that should work
      Attached Files
      Products: Damage, Stat and Resource System, Inventory System Support/Contact: Discord/E-mail
      Documentation: Synware

      Comment


        #4
        You have forward vector.
        Get also right vector to that capsule.
        Then use this: [rotate vector around axis]
        https://api.unrealengine.com/INT/Blu...xis/index.html

        In vector is your forward vector, axis is right vector.

        Comment


          #5
          Originally posted by Synia View Post
          I do not know if it helps you but I do something similar in a function. remove the part where I randomize the accuracy and use only the pitch (alpha in degrees). that should work
          Originally posted by Nawrot View Post
          You have forward vector.
          Get also right vector to that capsule.
          Then use this: [rotate vector around axis]
          https://api.unrealengine.com/INT/Blu...xis/index.html

          In vector is your forward vector, axis is right vector.
          Yeah, thank you guys I was solve the problem quite after the post (as it usually happens)
          DrawDebugCoordinateSystem - helps a lot, cause clearly show why i dont rotate forward vector properly )

          Comment

          Working...
          X