Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0

Question

4 answers to this question

Recommended Posts

  • 0

To throw a grenade, you can instantiate an object, pressing a key - and then apply a force on its rigidbody. Using a coroutine, instantiate explosion FX after a while, destroying the previous intantiated object. Use sphereCast to apply damage inside a radius. To create a smoke grenade, there is many way to do that, but personnaly I would like to use plane and texture (always facing to player) playing with size, rotation and alpha. Maybe it could waste system ressource ++

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

 

 

Share this post


Link to post
Share on other sites

  • 0

Take a look at links which I shared. Each of them has its own example.

If you cannot integrate them in the FPS kit, I assume that you have to learn basics firstly. It's not a reproach - we did that too ++

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

As geckoo said, you can use that to make a grenade.

I will give you the guide using that(except the WaitForSeconds)

First, frag grenade:

make a bool that checks the player gets the key down.

Make a float which is the delay and a timer that equals the delay at the start.

if it gets the key down, the countdown goes down to 0(by seconds).

if the countdown goes to 0. Instantiate the object(grenade)

and in the frag grenade, make a script which will have also a delay(5 seconds, for example)

if it goes to 0, then Instantiate an explosion.

Use the sphereCast to catch the rigidbodies in the area, or the players to damage them(or both).

For rigidbodies, use rigidbodies.AddExplosionForce(force);

Smoke grenade:

Use the same steps, but instead of an explosion and SphereCast, use a smoke particle

and for details, make a trigger inside the smoke that if the player is near, the screen fades to gray.

Sorry if my English is bad, or my explanation is bad.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...