The throw object of grenade spawned from the wrong position.

wuyan

Member
Why does the throw object of grenade spawned behind the character, not from the right hand. I didn't find where to set it up correctly. Where to set it?Thanks!
1605382240833.png

1605382241006.png
 
The grenade is thrown when the use animation event is sent: https://opsive.com/support/document...controller/animation/animation-event-trigger/

This video gives details on how the grenade is setup:
Hi Justin,

I watched the video over and over. Yes, it will be thrown at the right time. But the position is not correct. Please see the screenshot. When event is sent, the grenade is spawned at the wrong position instead of the right hand. This position appears to be symmetrical to the position of the right hand. Actually, look at my screenshot yesterday. This is also the case in the demo of TPC. In the demo, it's just that the right hand is closer to the axis of symmetry when the event is sent . Therefore, the deviation is not large and it is not easy to found. But it's like the second screenshot I showed yesterday. If the right hand is stretched forward more in the new animation, it will look strange. And grenades often hit yourself.1605502467798.png
 
The grenade is thrown when the use animation event is sent: https://opsive.com/support/document...controller/animation/animation-event-trigger/

This video gives details on how the grenade is setup:
Hi Justin,

1,I watched the video many times. Yes, it will be thrown at the right time. But the position is not correct.

Please see the screenshot. When event is sent, the grenade is spawned at the wrong position instead of the right hand. This position appears to be symmetrical to the position of the right hand. Actually, look at my screenshot yesterday. This is also the case in the demo of TPC. In the demo, it's just that the right hand is closer to the axis of symmetry when the event is sent . Therefore, the deviation is not large and it is not easy to found. But it's like the second screenshot I showed yesterday. If the right hand is stretched forward more in the new animation, it will look strange. And grenades often hit yourself.
1605505359908.png

2, By the way, I asked another question in another post. Can you have a look? Thank you!
Link:How to make the View type change with Movement Type?
 
Last edited:
Hi wuyan, you're absolutely right, I just checked in the demo scene. When any ThrowableItem gets thrown, its transform parent gets changed from the rig to null, which is where the issue seems to occur. I'll let Justin know about this to see if there's a quick workaround.
 
Hi wuyan, you're absolutely right, I just checked in the demo scene. When any ThrowableItem gets thrown, its transform parent gets changed from the rig to null, which is where the issue seems to occur. I'll let Justin know about this to see if there's a quick workaround.
Hi, I have noticed that this problem is still unresolved. Is there a quick workaround?
 
I have not been able to look into this yet but I'll let you know as soon as I do.
 
I took a closer look at it and figured out the cause. When the character throws the item a raycast is performed to ensure the weapon doesn't spawn behind a wall. This raycast was hitting the character when the character should have been ignored. I will have this fixed in the next update but you'll want to add the following with the NEW comment within ThrowableItem.ThrowItem:

Code:
            var collisionEnabled = m_CharacterLocomotion.CollisionLayerEnabled;// NEW
            m_CharacterLocomotion.EnableColliderCollisionLayer(false);// NEW
            if (!m_CharacterLocomotion.ActiveMovementType.UseIndependentLook(false) &&
                            Physics.Linecast(m_CharacterLocomotion.LookSource.LookPosition(), m_InstantiatedTrajectoryObject.transform.position, out m_RaycastHit,
                                                m_ImpactLayers, QueryTriggerInteraction.Ignore)) {
                m_InstantiatedTrajectoryObject.transform.position = m_RaycastHit.point;
            }
            m_CharacterLocomotion.EnableColliderCollisionLayer(collisionEnabled); // NEW
 
Hi Justin, Thank you!The problem seems to have been solved.
I took a closer look at it and figured out the cause. When the character throws the item a raycast is performed to ensure the weapon doesn't spawn behind a wall. This raycast was hitting the character when the character should have been ignored. I will have this fixed in the next update but you'll want to add the following with the NEW comment within ThrowableItem.ThrowItem:
 
Top