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
Sign in to follow this  
fpsarmedunity

Pickup Grenade issue FPSKIT

Question

Hi to al i'm experimenting with my fpskit  template and  thaks to OMA and TheMars  I added many cool stuffs  like inventory system, parkour, damange trigger system, simple static ranged ai, survival system (hunger, thirst, stamina, cold, radiation ect),  and so on..

 

Now I'm managing to add throwables like wepaons and spears ect.. and I integrated the Grenadescript from old Fpskit and all works fine.. player can pickup grenades, throw them, items are correcly added to inventory and and dropped from it ect... My only issue the ammo pickup after player picked up weapon..

i try to explain better

when player approach the weapon it can pickup the weapon and grenade goes into a weapon slot like other weapons ..but if player try to take another grenade ..since grenade is a weapon itself i got the message "weapon already equipped)

like the video..waht i want to know is if is there a way i can make player pickup many grenades sewunatially and these t obe added to the total grenade count

any help is appreciated

Please login or register to see this link.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts


  • 0

every weapon has own index (including grenades), right?
check for grenade index in script where you pick up weapon.

Share this post


Link to post
Share on other sites
  • 0

yes i know i must to add something in this part of code but rally cannot figure what...eheheh

Please login or register to see this code.

 

Share this post


Link to post
Share on other sites
  • 0

anyone could try to help me?'

 i added this code into weaponmanager script like old 1.3.5 but result doesnt change

 

Please login or register to see this code.

specifically added these lines into it

 

 if (setElement == 6)
                    {
                        Pickup pickupGOW1 = hit.transform.GetComponent<Pickup>();
                        addStickGrenades(pickupGOW1.amount);
                    }
                    Destroy(hit.transform.gameObject);
                }
                else
                {
                    if (setElement == 6)
                    {
                        if (Input.GetKeyDown("e"))
                        {
                            Pickup pickupGOW = hit.transform.GetComponent<Pickup>();
                            addStickGrenades(pickupGOW.amount);
                            Destroy(hit.collider.transform.parent.gameObject);
                        }

 

 

like the grenade into fpskit 1.3.5 

 

and added the void

Please login or register to see this code.

 

this in fpskit 1.3.5 work like a charm but  i cannot manage to get it work into 1.6

Share this post


Link to post
Share on other sites
  • 0

Is it really so hard to learn how to use debug/print to check which part of code is not working correctly?

Share this post


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

eehehe. no Master.. is not this the point-... 

 

the fact is that i'm not sure if this type of code could work  like i want so would to have some hints on how to manage that..

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.

Sign in to follow this  

×
×
  • Create New...