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
hoshjalverson

[FPSKit]WeaponManager has an "IndexOutOfRangeException" error

Question

w9efs4E.png?1

 

 

This error comes up when I try to pick up my custom weapon, but only that weapon, everything else is fine. 

 

Weaponmanager script

Please login or register to see this code.

I followed Please login or register to see this link. tutorial (first one I found) and got to 4:25 and came across this problem. If you need any more info just let me know!

Thanks!

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

You got a problem with your array.

Maybe your forgot to put this weapon in the inspector - with others ++

Share this post


Link to post
Share on other sites

  • 0
Please login or register to see this quote.

 

In the weaponmanager inspector? like this? Still get the error. I'm fairly new to scripting and havent quite found how to find these errors.

Thanks for the response!

 

E20efDM.png?1

Edited by hoshjalverson

Share this post


Link to post
Share on other sites
  • 0

no, you skipped a number on your weapon index and on your weapon managers....

 

recheck the numbers like,

1=1

2=2

 

cause you get it if its 

1=1

2=3

 

thats example

Share this post


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

That worked, thanks! although now, when I have my weapon equipped and try to pick up another weapon I get the same error on the same line

Edited by hoshjalverson

Share this post


Link to post
Share on other sites
  • 0

then you havn't added a trigger, or tagged it as weapon, or you havn't added the weapon index script..  please check every object before asking again

Share this post


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

I checked everthing 3 times, or more. everything is tagged as it should be, checked the weapons already in there and the triggers are the same, and all the weapon index scripts are added. Im confused

Share this post


Link to post
Share on other sites
  • 0

do the numbers also equal eachother? (in the weaponindex)

Share this post


Link to post
Share on other sites
  • 0

But do you have nine set on the array of weapons? Like do you only have an array of 8 weapons and your trying to look for something not there

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...