Grenade clone is spawned in character's hand.

ebiflychan

New member
Hi, I bought Third person controller these day.
I watched grenade tutorial of third person controller, but it does not work.
Actually the grenade is spawned, but it is located in right hand.
1628115396452.png
There is also included agility pack and climbing pack in my scene.
Third person controller version 2.3.5
agility pack version 1.1.1
climbing pack version 1.0.2
unity version 2019.4.26f1
 
Last edited:
Have you set the Slot ID of the grenade item to 1 (matching the slot of your character's left hand ItemSlot component)? Have you defined the Item Sets in the Item Set Manager to include the grenade in slot 1/left hand?
 
I found those component and they are blank.
assumption: There is only grenade in my hand.
Slot ID
1628156137219.png
Item Set Manager
1628156177240.png
It does not create component automatically like assault rifle.
How can I setup these component?
May you present any tutorial if you have, please.
or just read official reference.
 
The grenade video is accurate for the current version. If you aren't getting the same results I would go through that video again. As soon as you are getting a different result I would stop the video and backtrack until you have a similar setup. This will allow you to fix what was going wrong at that time.

The right hand grenade should be in slot 0.
 
I still have not been able to solve this problem.
I did it many times faithfully before I was told, and I did it after, too.
I also thoroughly reviewed some tutorials on the prerequisites.
It's working in the demo, so I know it's not a bug in the script; I don't get any errors too.
The grenade is in character's right hand. So I know that the slot must be set to 0.
1628253358892.png
1628253279172.png
I made the following category settings for grenades that are not mentioned in the tutorial video.
1628253591539.png
However, the grenade will still be cloned into the right hand child.(so the grenade will not fly out of character's hand.)
I was wondering if there are any important settings that aren't in the tutorial video by update.
 
Last edited:
At what point in the video do your results differ? The recent updates do not change the workflow so it has to be something else.

The Third Person Grenade Item Properties is what determines where the grenade is thrown. Does ThrowableItem.ThrowItem get called?
 
The running grenade clone between 4:02~4:07 in the grenade tutorial does not move from the right hand child to the top of the hierarchy. (I just noticed that it switches places)
In the tutorial state, I used the debug log to confirm that the ThrowableItem.ThrowItem is not being called.
It is called when the use event of the grenade item is turned off.
 
Ok, ThrowItem is responsible for doing that movement. ThrowableItem.ThrowItem is called from the Use Event on the Grenade Item component. In the demo scene/video it is using an animation event. Does the throwing animation play? Can you log animation events on the Animator Monitor and see if OnAnimatorUseItem gets called?
 
Thank looks good. Is Wait For Slot Event enabled for your Use event?

1628265448776.png
 
Last edited:
When you enable it it should work. I'm not sure why it wasn't enabled by default. I'll take a closer look at that.
 
Unfortunately, the grenade doesn't fly out of character's hand when I turn it on. The log doesn't change either.
1628265774390.png
 
Can you set a breakpoint within Use.OnItemUseFirstSlot to see why the method returns early? This will be executed when OnAnimatorItemUseFirstSlot is called. UseItem(0) should be called which will allow Use.LateUpdate to continue and call m_UsableItems.UseItem()
 
This is the first time to do breakpoint. It'll take a while. (I didn't know this feature existed in unity.)
 
Interesting. As a test if you force that first if condition to return true and register the OnAnimatorItemUseFirstSlot event does the OnItemUseFirstSlot get called?
 
Awesome, so it's being thrown now? I will dig into some more why it wouldn't be registered correctly.
 
Top