Bug In Rotation Recoil Of Weapon

MAK

New member
I have set rotation recoil for weapon to test does it really effects on character, by this i came to know that it's not working as expected.

To test i have set X value to min -180 & max -180, with this values when character facing world forward direction it's working as expected but when character changes it's direction it's not working as expected. Please see bellow GIF link.

https://media.giphy.com/media/IdBfUoeP8Sc5Ob6iPx/source.gif

Thanks.
 
When you specify a min and max value of -180 you should also specify the min magnitude of 180. Right now it is randomly choosing between the whole range so I think the character direction is just a coincidence.
 
When you specify a min and max value of -180 you should also specify the min magnitude of 180. Right now it is randomly choosing between the whole range so I think the character direction is just a coincidence.
I tested this and also tested with static values rather then random values by changing this line in ShootableWeapon

EventHandler.ExecuteEvent(m_Character, "OnAddSecondaryForce", m_Item.SlotID, m_PositionRecoil.RandomValue, new Vector3(-80,0,0), !m_LocalizeRecoilForce);

But same issue
 
Can you list the steps to reproduce within a fresh 2.1.8 project?

Reproduce Steps With Version 2.1.8 Method 1

1. Start demo scene
2. Play as 3rd Preson
3. Equip Assault Rifle
4. Select AssaultRifle from Items and inspect Shootable Weapon
5. Set values according to attached Recoil screen shot
6. Set Look Sensitivity to 0 in ThirdPersonShootableWeaponProperties Component
7. Then Fire in Forward,Left,Right & Back direction then you will see difference

As you said in your first reply
"it is randomly choosing between the whole range so I think the character direction is just a coincidence "
so i verify by method 2

Reproduce Steps With Version 2.1.8 Method 2

1. Open ShootableWeapon.cs script and go to line 1019 and paste bellow line

EventHandler.ExecuteEvent(m_Character, "OnAddSecondaryForce", m_Item.SlotID, m_PositionRecoil.RandomValue, new Vector3(-180,0,0), !m_LocalizeRecoilForce);

Here i am not sending Rotation Recoil Random Value. Instead of this i am sending static new Vector3(-180,0,0)

2. Start demo scene
3. Play as 3rd Preson
4. Equip Assault Rifle
4. Select AssaultRifle from Items and Set Look Sensitivity to 0 in ThirdPersonShootableWeaponProperties Component
5. Then Fire in Forward,Left,Right & Back direction then you will see difference

Hope this helps.
Thnaks.
 

Attachments

  • Recoil.png
    Recoil.png
    15 KB · Views: 7
Thank you for the steps to reproduce. To fix this open Character IK and change the following on line 772 within RotateHands from:
Code:
Quaternion.Euler(i == 0 ? m_LeftHandRotationSpring.Value : m_RightHandRotationSpring.Value)
to:
Code:
Quaternion.Euler(m_Transform.TransformDirection(i == 0 ? m_LeftHandRotationSpring.Value : m_RightHandRotationSpring.Value))
 
Top