Announcement

Collapse
No announcement yet.

Line Traces are left-sided

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

    Line Traces are left-sided

    Hi there, I am working on inaccuracy of my weapons.

    The Idea:
    Get ForwardVector from Character
    Get Point infront of Character in 10m.
    Apply inccuracy to this point by adding a random inaccuracy vector.
    GetDifference between new point and Character
    Normalize
    This is the ForwardVector for the Trace

    However, the traces are somewhat left sided, even though the inaccuracy is both negative and positive.

    My Graph looks like this:
    Click image for larger version

Name:	Inacc2.JPG
Views:	1
Size:	86.3 KB
ID:	1209361
    Click image for larger version

Name:	inacc.JPG
Views:	1
Size:	143.9 KB
ID:	1209362
    Click image for larger version

Name:	ScreenShot00000.png
Views:	1
Size:	254.2 KB
ID:	1209363

    Do I overlook somehting?

    The Trace is also turned to the left when I set the Inaccuracy to 0.
    Last edited by Raildex_; 02-12-2017, 07:44 AM.

    #2
    Can you make your ActorForwardVector visible and show the last image again?

    In addition 2 points you probably missed:
    - Converting the result of your RandomFloatInRange node to a vector results in each coordinate of a vector having the same value. I doubt you want that, I guess you want each coordinate of your vector be random on their own.
    - Your way of applying inaccuracy results in the possible end points of your trace to shape a cube (at least after taking care of my first point, currently they do even only shape a line). That's really unrealistic. Instead you want to apply inaccuracy by rotating your actor forward vector slightly in each coordinate (and then multiply it with the length of your trace). The resulting possible end points will then realistically shape a cone.
    Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

    Comment


      #3
      The line trace end is at the projectiles forward vector + a distance. In world space. You want it to be relative to the character, so add the actor location.

      So End =( projectile forward vector) * (distance) + (actor location).

      Comment


        #4
        Originally posted by ste1nar View Post
        The line trace end is at the projectiles forward vector + a distance. In world space. You want it to be relative to the character, so add the actor location.
        Oh, missed that
        Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

        Comment


          #5
          Originally posted by ste1nar View Post
          The line trace end is at the projectiles forward vector + a distance. In world space. You want it to be relative to the character, so add the actor location.

          So End =( projectile forward vector) * (distance) + (actor location).
          Thank you so much. I always forget that xD

          Comment

          Working...
          X