Announcement

Collapse
No announcement yet.

Projectile is not hitting directly where the crosshair is pointed

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

    Projectile is not hitting directly where the crosshair is pointed

    I have a problem whereby whenever I fire off my projectile it does not land where the crosshair is pointed.
    Click image for larger version

Name:	Screenshot (13).png
Views:	1
Size:	335.9 KB
ID:	1170442
    Click image for larger version

Name:	Screenshot (14).png
Views:	1
Size:	407.4 KB
ID:	1170443

    Here is the blueprint for my projectile. Basically I fire off the projectile and it spawns a static mesh version of the projectile at the hit point and the destroys the flying projectile so that they are not two of them.
    Click image for larger version

Name:	Screenshot (8).png
Views:	1
Size:	303.4 KB
ID:	1170444Click image for larger version

Name:	Screenshot (9).png
Views:	1
Size:	317.7 KB
ID:	1170445Click image for larger version

Name:	Screenshot (10).png
Views:	1
Size:	396.6 KB
ID:	1170446Click image for larger version

Name:	Screenshot (11).png
Views:	1
Size:	398.9 KB
ID:	1170447Click image for larger version

Name:	Screenshot (12).png
Views:	1
Size:	378.7 KB
ID:	1170448

    Can someone please help me solve this problem?
    I am kind of a newbie. Thanks in advance

    #2
    In our projectile handling, OnBeginOverlap triggers everything, and we simply use collider's world location to spawn effects, rather than tracing again to work out where to spawn it.

    Double check that your static mesh has pivot where it should have it (and not off by the amount of error you're seeing)

    Welcome to unreal forums! And great job screenshotting your question!
    • Follow me on twitter
    • Visit our website traverse.world
    • Checkout our game's forum thread

    Comment


      #3
      Did you offset your cross hair in your HUD? The default FPS project doesn't have a centered crosshair, if you built off that then your crosshair will also not be centered.

      The top left corner of the texture is the middle of the screen, so you need to offset its location by -8/-8 (half the texture resolution x and y) to make the center of the texture the middle

      It's a silly error that has persisted for as long as the FPS project has existed
      Last edited by DEDRICK; 01-18-2016, 12:30 PM.

      Comment


        #4
        Do you trace your crosshair to an actual surface of the target in the world? Your bow is to the left from the camera and if you spawn your arrow at position of the bow then it's already offset from the center of the screen.
        Youtube Channel

        Comment


          #5
          Thanks for the replies guys!
          It turned out that my Gun Offset vector values were not correct so I fixed them and now it works perfectly!

          Comment

          Working...
          X