#a thread for debugging

1 messages · Page 1 of 1 (latest)

woven pivot
next rose
#

just make your Pickup() take the picked up weapon as a parameter

#

and store it somewhere

woven pivot
#

how?

next rose
#

sorry but I don't have time or will to walk you through every step

#

I can point you into directions

woven pivot
#

I can't figure out how.

next rose
#

with your current system you can try if (equippedAny[i]) continue;

#

in the for loop

#

if i understand your bool array mess correctly

#

(not an answer on how to add parameter to pickup, but how to skip your current gun in the loop)

next rose
#

yeah and I had no idea what equippedAny is

woven pivot
#

yeah my bad.

#

I thought you checked it again.

#

afterwards.

next rose
#

I just did

#

and gave you an answer

woven pivot
#

yeah

#

the problem is that if the first gun (0 in the array) is equipped, it does nothing.

#

(it doesn't debug.)

woven pivot
#

although it shouldn't continue, should it?

#

I wanna ignore the currently equipped gun.

#

and set the index to the closest gun that's not the equipped gun.

#

if it's within the range.

#

(inRange)

next rose
#

continue skips to the next iteration..

#

as you could google, or study C#, but you just guessing your way thru

woven pivot
#

I tried it, it doesn't work.

#

it just stays at the currently equipped gun's index.

next rose
#

yeah because youre probably getting an error

woven pivot
#

I'm not.

#

as in a console error?

next rose
#

yes

woven pivot
#

there's none.

next rose
#

you should put the continue check at the start of for loop

#

just under for {...

woven pivot
#

ok

next rose
#

why would you check things first and THEN skip/continue?

woven pivot
#

idk

#

although it still doesn't work.

#

nevermind!

#

I'm just stupid.

next rose
#

can you test things for more than 3 minutes without saying 'doesn't work'

woven pivot
#

maybe

next rose
#

and try to figure it out yourself first