Announcement

Collapse
No announcement yet.

Gun Sight Aligner

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

    #31
    PeaceSells_

    Immediate thought: I removed hands to make animation simpler, so it might count as "arm->forearm"
    I'm using the forearm's "end" bone for the IK, but that might not be "enough".
    (also, idk about when you tested it, but the IK works perfectly fine in the ABP for both arms, although that might have nothing to do with this and im just dumb)
    Anyway, i'll try looking for another node, but don't know much about IK in unreal so dont really know what else to do atm.

    Thanks
    (x3)
    Last edited by Nonecares.; 09-17-2020, 04:17 PM.

    Comment


      #32
      Hello PeaceSells_

      Saw the response in the Marketplace:

      This project started as an anim solution, that's why it has no replication. Replication adds a layer of complexity that, for many costumers, gets in the way of integrating the asset's actual main feature - auto aligning. I currently have no plans for including replication in this asset (this could change), but I do have another asset that has both auto-aligning and replication. However, the character in that asset isn't full-body 1st person yet, it's arms-only 1st person. I'm currently working on making him full-body 1st person.
      Firstly, I appreciate the prompt response. I'm electing to wait for Full-body Alignment to be added to FPS Assemblable Gun as I need multiplayer weapon customization as well. That is a Very Slick Rail system. Ill subscribe to that thread for updates. Thanks again.


      Last edited by TechLord; 09-18-2020, 02:19 AM.
      HeadlessStudios.com is now part of TheGameDevStore.com

      Comment


        #33
        TechLord

        Thanks, that's what I would advise if you want full-body + replication + auto alignment.

        Regards
        My Marketplace assets:
        Gun Sight Aligner
        Shooter Gun System

        Comment


          #34
          Originally posted by PeaceSells_ View Post
          TechLord

          Thanks, that's what I would advise if you want full-body + replication + auto alignment.

          Regards
          if our game already has aim mechanics replicated, would adding this be as simple as plug n play? After migrating the asset

          Comment


            #35
            Originally posted by thelazylion View Post

            if our game already has aim mechanics replicated, would adding this be as simple as plug n play? After migrating the asset
            No, in any case it's not as simple as plug n play. You will have to integrate anyway.
            My Marketplace assets:
            Gun Sight Aligner
            Shooter Gun System

            Comment


              #36
              Originally posted by Nonecares. View Post
              PeaceSells_

              Immediate thought: I removed hands to make animation simpler, so it might count as "arm->forearm"
              I'm using the forearm's "end" bone for the IK, but that might not be "enough".
              (also, idk about when you tested it, but the IK works perfectly fine in the ABP for both arms, although that might have nothing to do with this and im just dumb)
              Anyway, i'll try looking for another node, but don't know much about IK in unreal so dont really know what else to do atm.

              Thanks
              (x3)
              Seems like I skipped your post, my bad.

              If I understood it correctly, your "end" bone is where the hand bone would normally be, so your skeleton is:

              arm->forearm->end
              which is the same as

              arm->forearm->hand
              (Epic's skeleton, just with different names)

              So if you're attaching the gun to the "end" bone (or to a socket on the "end" bone) and replacing the references to "hand_r" with references to "end" in the code, then alignment should be working normally. This way, the "end" bone would already be the IK effector, and that is enough, yes. (Unless I didn't understand your setup)


              Originally posted by Nonecares. View Post
              (also, idk about when you tested it, but the IK works perfectly fine in the ABP for both arms, although that might have nothing to do with this and im just dumb)
              In my test the IK worked from hand to forearm, while the upperarm would keep in place. It looked fine, but the gun wouldn't get to it's place in front of the camera, because with only hand and forearm moving, it doesn't have enough reach. That's why I'm saying it wasn't a problem with the IK, it was working like it's supposed to, it was a skeleton problem...
              My Marketplace assets:
              Gun Sight Aligner
              Shooter Gun System

              Comment


                #37
                Originally posted by PeaceSells_ View Post

                That's why I'm saying it wasn't a problem with the IK, it was working like it's supposed to, it was a skeleton problem...
                Hi yeah its a skeleton problem. I originally thought it couldn't be right because of the way its not working. it (presumably) can reach, its just flying off behind the camera. I went in "game" to take another look, and i noticed it looked like its moving around the sight VB. I tried thinking of what was wrong with it, and somehow remembered your mixup with arms only and full body. So I thought the ABP instructions might be for full body. So i looked in both mannequin skeletons, and the sight VB is attached to the head on full body, and the root bone on arms only. So i redid the VB to the root bone and sure enough, it works now (although some sights are tilted a little which is weird but ok).

                So yeah, you need to change the instructions on the arms ABP to say to attach the sight VB to the root.

                I wish i noticed earlier, thanks for tryna help, i wouldnt have noticed if it werent for this so yeah, thanks

                And now, we have a final thank you count... of 7. I had a joke to go here biut i forgot it oops

                Comment


                  #38
                  Originally posted by Nonecares. View Post

                  Hi yeah its a skeleton problem. I originally thought it couldn't be right because of the way its not working. it (presumably) can reach, its just flying off behind the camera. I went in "game" to take another look, and i noticed it looked like its moving around the sight VB. I tried thinking of what was wrong with it, and somehow remembered your mixup with arms only and full body. So I thought the ABP instructions might be for full body. So i looked in both mannequin skeletons, and the sight VB is attached to the head on full body, and the root bone on arms only. So i redid the VB to the root bone and sure enough, it works now (although some sights are tilted a little which is weird but ok).

                  So yeah, you need to change the instructions on the arms ABP to say to attach the sight VB to the root.

                  I wish i noticed earlier, thanks for tryna help, i wouldnt have noticed if it werent for this so yeah, thanks

                  And now, we have a final thank you count... of 7. I had a joke to go here biut i forgot it oops
                  Thank you for this, it makes perfect sense. In my head I had thought about making VB sight a child of the root in the arms-only skeleton (to avoid problems like this), but I didn't remember actually doing it. I will update the instructions in v2.0.3, since v2.0.2 is aleady out.

                  I'll try to find out what could be causing your sights to be a little tilted.

                  Thank you!
                  My Marketplace assets:
                  Gun Sight Aligner
                  Shooter Gun System

                  Comment


                    #39
                    Updated to 2.0.2

                    Change log:

                    - 3rd person camera moved a little to the side, so the character isn't exactly in the center of the screen anymore

                    - Quick fix: the variable CycleSightsSpeed is now wired to the interpolation (Ease node) in the character's anim blueprint. So now changing the gun blueprint's own variable CycleSightsSpeed will customize the speed of switching sights while aiming, as it's supposed to.
                    My Marketplace assets:
                    Gun Sight Aligner
                    Shooter Gun System

                    Comment


                      #40
                      Updated to 2.0.3

                      Change log:

                      - Quick fix: instructions for setting up virtual bones in a custom skeleton, written in the anim graph of the arms-only anim blueprint - fixed.
                      My Marketplace assets:
                      Gun Sight Aligner
                      Shooter Gun System

                      Comment


                        #41
                        Updated to v2.0.4:

                        Chang log:

                        - Reorganized code and comments with integration in mind. It now should be easier to visualize what events should go where, when integrating with other projects.
                        My Marketplace assets:
                        Gun Sight Aligner
                        Shooter Gun System

                        Comment


                          #42
                          Hey there, bit of a problem after converting to alsv4's skeleton..

                          I added all the correct virtual bones, i added the fullbody animbp as a linked overlay layer in als' animbp, replaced all references to point to the correct linked layer. then reparented the b_character_fullbody as a child of als' anim man..

                          Now i get a problem where the gun does not go into ads, just holds the base idle pose. but when aim is activated, the right hand snaps to the head and aims backwards.

                          Ideas? or more information you can point towards changing the character?
                          Attached Files

                          Comment


                            #43
                            thelazylion

                            The character in the 1st image you sent doesn't seem to be in-game, it looks like he's in the viewport of the anim BP or the anim viewer. Only when he is in-game, and with the gun in his hands, the positions of the gun sights are calculated (CalcSightsTransforms) and sent to the anim BP. If I look at my character aiming in the anim BP viewport, I get a similar result to yours:


                            Click image for larger version

Name:	Capture.JPG
Views:	155
Size:	52.2 KB
ID:	1820726


                            So don't forget to bring CalcSightsTransforms to your gun BP (and call it when the gun is attached to your character's hand) and test your character in-game. If you're getting similar results in-game, there could be something missing in the CalcSightsTransforms implementation.

                            I haven't tried yet to apply the Gun Sight Aligner to the ALS character (will probably try it when I have some time), but I believe it should be possible.
                            My Marketplace assets:
                            Gun Sight Aligner
                            Shooter Gun System

                            Comment


                              #44
                              Originally posted by PeaceSells_ View Post
                              thelazylion

                              The character in the 1st image you sent doesn't seem to be in-game, it looks like he's in the viewport of the anim BP or the anim viewer. Only when he is in-game, and with the gun in his hands, the positions of the gun sights are calculated (CalcSightsTransforms) and sent to the anim BP. If I look at my character aiming in the anim BP viewport, I get a similar result to yours:


                              Click image for larger version  Name:	Capture.JPG Views:	0 Size:	52.2 KB ID:	1820726


                              So don't forget to bring CalcSightsTransforms to your gun BP (and call it when the gun is attached to your character's hand) and test your character in-game. If you're getting similar results in-game, there could be something missing in the CalcSightsTransforms implementation.

                              I haven't tried yet to apply the Gun Sight Aligner to the ALS character (will probably try it when I have some time), but I believe it should be possible.
                              That screen shot is of the anim bp, but Ingame.

                              There is a preview feature for debugging, while the game running in editor, you can select from a drop down at the top, a list of active anim BPs being used in the world.. and it'll mimic what is playing in game.

                              So yeah it does the same in game..

                              I'll look until the calc sights implimentation, thanks for the heads up on that.

                              I just reparented the class over the als one. So I assume it's in the the anim bp I missed.

                              Comment


                                #45
                                Originally posted by thelazylion View Post
                                I just reparented the class over the als one. So I assume it's in the the anim bp I missed.
                                CalcSightsTransforms is in the gun bp, it needs to be in your gun bp (or your gun bp's parent class) and be called after the gun is attached to the character's hand. The Gun Sight Aligner's example character attaches the gun and calls its CalcSightsTransforms at EventBeginPlay. CalcSightsTransforms contains a ref to the hand bone - hand_r - and if your bone has a different name, you need to change the ref to match your own bone name, although I think the ALS character's hand bone name is also hand_r.
                                My Marketplace assets:
                                Gun Sight Aligner
                                Shooter Gun System

                                Comment

                                Working...
                                X