PlayMaker Help & Tips > PlayMaker Help

Random Weighted int problem [SOLVED]

(1/4) > >>

djaydino:
hi, i wanted to use the custom Action : Random Weighted int
But it is giving me the result 0,1,2,3,4,5
and not the numbers i placed in them.
i am using (testing) unity 4.6.0.b17

i have set it up like this :

jeanfabre:
Hi,

oups.. Unfortunalty, there is a mis usage of the function, it actually returns the index of the int, not the int itself...

I have corrected the action, delete it from your project and redownload it from the ecosystem.


Bye,

 Jean

djaydino:
ah ok thx

djaydino:
hi, i was just testing the random weights and set it up like this :


free image uploading

The problem is that the result goes like this : 1 / random 2-6 / 1  / random 2-6 / 1  and so on

so when it hits 1 the next one can't be 1

the way thought it would be is that 1 would be the result  99/100 times.

is it suposed to be like this?

if so is there a different way to do the random?

thx for the help.

jeanfabre:
Hi,

 This is not what I experience when every ints has the same weight. I guess that you are using random weighted Int because you are assigning various weights to the different values, so some values will be picked more than others.

 Can you show me your action and the number and their respective weight?

Bye,

 Jean

Navigation

[0] Message Index

[#] Next page

Go to full version