help with grenade FPS game
I am making a grenade in my game then my demo is done for the google Play Store Console Open Testing.
In the screenshot is what is going on in the Inspector with the grenade.
The hand that does the Animation for the grenade throw, and the grenade are turned off and they are a child of the Unity Starter Assets FPS Controller's PlayerCapsule.
The Grenade button is a child of the Unity Starter Assets FPS Controller's UI_Canvas_StarterAssetsInputes_Joysticks.
I have to drag the grenade button into the box in the script in the Inspector.
The Grenade button is switched off because it only turns on when the player is holding a grenade to keep the Canvas clear of clutter with the sprites.
In the animator controller for Hand for grenade the animations are set up like this:
From Entry there is a transition going from Entry to New State, then a Transition going from New State to Hand for grenade.
The grenade in the boss room that the player (The Unity Starter Assets FPS Controller picks up) has the GrenadePickUp script on it to make the grenade disappear when the player picks it up, (this is working fine)
This is the GrenadePickUp script that is on the grenade in the boss room that the player (Unity Stater Assets FPS Controller picks up)
This is the GrenadeButtonController script that is on the Grenade sprite button.
There are 2 more scripts that handle the grenades forward force and spin, and the explosion and sound effect but these are working fine, no need to show you these 2 scripts.
My grenade animation will not play when I press the sprite button can you help me?
I have been on this problem for like almost seems like 3 years.😞
2 Replies
I think it is better to ask this question in $unity discord server. This one is more general C#