- Home /
3rd Person Throwing Grenade Question
Hi all! I'm currently developing on a game called Three Worlds, a 3rd Person game. Everything is all set up, the levels, player etc. Now i want to get started on weapons. I've decided to start off with the grenades. I managed to create a 'throwing grenade' animation for the character and now here's the tough bit.
Just as i click the button to throw the grenade (Left Mouse Button), the grenade appears when the character animation looks like as if he is throwing the grenade and the grenade is then thrown somewhere, like force is applied to it with the rigibody attached, and after about 3 seconds, the grenade explodes.
I've managed to create the models, the explosion particle effects but i want to know the coding for this to work. I'm not much of an experienced scripter so i'm not exactly sure what to do.
Have you made the animation using bones if so you can easily parent the grenade to your hand bone to make it follow the movement of the arm. so you instantiate at transform.position of the bone. then you could try checking the speed and detach it with this force not sure if it would work though. just an idea
Also you can give it a layer like grenade, and go into the physics options and turn off physics between the player and the grenade to ensure that your model doesn't interfere with it.
Your answer
Follow this Question
Related Questions
Make grenade roll out when it leaves hand 1 Answer
Make grenade apply force to rigidbodies around it 3 Answers
Only 2 Grenades 2 Answers
throwing objects 1 Answer