Announcement

Collapse
No announcement yet.

Gun Sight Aligner

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

  • replied
    Hello insideitall ,

    Well, I'm glad to see that the issue resolved itself!

    Anyway, it sounded to me like the 1 frame lag you get when you retrieve a bone position from the event graph to use in the anim graph. But from your solution, it seems like it was a different issue after all.

    Thank you for reaching out and please let me know if you have more questions!

    Leave a comment:


  • replied
    Hey PeaceSells_ Firstly great project, well documented!
    I'm trying to port over your animation blueprint code to my own as i've got features already implemented, but i'm going piece by piece not to mess anything up, it's all going well so far except i'm having issues with, what i assume is 'pitchperbone' I'm finding that my controller pitch is either too fast and the arms aren't in sync with the camera position, they're moving, but much slower than the camera.
    Do you have any suggestion on how to debug this?

    Thanks


    *EDIT*
    Seems to have resolved itself, i think it happened when copying over some of the transform bone nodes, i toggled some of the bones on and off and is working fine now.
    Last edited by insideitall; 12-04-2020, 06:24 PM.

    Leave a comment:


  • replied
    rdograndy

    Hey, I've just answered your question on the store page:

    https://www.unrealengine.com/marketp...14af/questions

    Please let me know if you have more questions!

    Leave a comment:


  • replied
    I got the ads portion working great, but when I'm not aiming the gun is pointed above my reticle. So when I shoot, it still goes to center screen even though my gun isn't. How do I fix this?

    Leave a comment:


  • replied
    Originally posted by PeaceSells_ View Post

    In your gun bp, in the "Components" panel (the one on the top left corner where you see your components hierarchy), just drag the mesh on top of the DefaultSceneRoot, and it will become the root automatically.

    Now about your issue, it's been resolved if I understand correctly?
    yes, it was a lot of work and to be honest I don't remember what I did exactly. But I had to add an offset to the calcsights transform in the anim bp to account for the als offset..


    Pistols are perfect however rifles that use optic aim are still not centered perfectly. I will keep tinkering

    Leave a comment:


  • replied
    Originally posted by BelliniVirgil View Post
    Would it be possible to add a tutorial on how to integrate everything properly in ALS? It would be super helpful, thank you
    I need to try and integrate it with ALS on my end first, to see what issues might come up. When I have the time I'll try it and, depending of how it goes, I'll make a guide...

    Leave a comment:


  • replied
    Originally posted by thelazylion View Post
    If I want to set the mesh as the root, instead of the scene, what would be the correct process of doing this with the least amount of unnecessary overhead?
    In your gun bp, in the "Components" panel (the one on the top left corner where you see your components hierarchy), just drag the mesh on top of the DefaultSceneRoot, and it will become the root automatically.

    Now about your issue, it's been resolved if I understand correctly?

    Leave a comment:


  • replied
    Would it be possible to add a tutorial on how to integrate everything properly in ALS? It would be super helpful, thank you

    Leave a comment:


  • replied
    Still happening., removing and re adding to project seemed to work with the default anim bp, even using the alsv4 skeleton/mesh. However I think due to a natural 2-3 degree offset in Alsv4's system, the aim is off by about a few degrees when ads'ing by default. This isn't too much of an issue. I'm just adding a 2-3 degree offset on any optical sight. Or maybe I'll just add a base offset at the end of the animbp..


    The issue is when the animbp is replaced with alsv4's animbp and everything is copy pasted over, including events, and references to the animbp are changed, the aim always just reverts to 0,0,0 on his head.

    Even though calc sight transform is printing a decent offset in the anim bp, i attached the calc sight on aim as well just to make sure, however still the same results as posted above.
    [Edit on the above]: Seems a macro didnt get copied over for the sight transform in animbp..


    Thanks again for the help..

    Another, quick (or possibly not) question while I move onto the next module of the project.
    If I want to set the mesh as the root, instead of the scene, what would be the correct process of doing this with the least amount of unnecessary overhead?

    Thanks again in advanced..


    Last edited by thelazylion; 10-17-2020, 11:47 PM.

    Leave a comment:


  • replied
    Originally posted by PeaceSells_ View Post
    thelazylion:

    Check if:

    1) ClacSightsTransforms is actually producing transforms: After attaching the gun to the hand, use a PrintString node to print the length and values of the SightTransforms array, which is filled by CalcSightsTranforms. Length of 0 means that CalcSightTransforms isn't working (or the gun has no tags or aimpoint sockets). Note: the Aim event of the product already includes a check to prevent trying to aim when this array is 0, but your character is already aiming in your pic, which tells me your array length isn't 0.

    2) The anim BP is actually receiving and using some value of this array: Use PrintString nodes in the anim BP to check the RelativeToHandLocation and RelativeToHandRotation values. They must be the same as the values in the SightTransforms array.
    thanks for the info, looks super useful. I'll get back to you with any updates..

    Thx again

    Leave a comment:


  • replied
    thelazylion:

    Check if:

    1) ClacSightsTransforms is actually producing transforms: After attaching the gun to the hand, use a PrintString node to print the length and values of the SightTransforms array, which is filled by CalcSightsTranforms. Length of 0 means that CalcSightTransforms isn't working (or the gun has no tags or aimpoint sockets). Note: the Aim event of the product already includes a check to prevent trying to aim when this array is 0, but your character is already aiming in your pic, which tells me your array length isn't 0.

    2) The anim BP is actually receiving and using some value of this array: Use PrintString nodes in the anim BP to check the RelativeToHandLocation and RelativeToHandRotation values. They must be the same as the values in the SightTransforms array.

    Leave a comment:


  • replied
    Originally posted by PeaceSells_ View Post

    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.
    Not sure whats wrong then, since I'm using the same example classes. I just parented the character under the als character, setup the anim bp and virtual bones, and the screenshot was the result..
    and yeah bone names are pretty much the standard.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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:	162
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.

    Leave a comment:

Working...
X