usually able to figure this stuff out but seems like its a lot harder than it should be. I’m trying to get percentage from two score managers. I successfully am getting their values and display them but cant seem to get a percent value from score / TotalScore. I keep getting errors because its not predefined value since its numbers from score manager.
when using division seems it just only wants predefined numbers.
Where is your division you want to do?
To divide, you need to put it inside of an ‘if’ statement.
To get percentages, I would recommend using the following formula to get the percentage something is of something else:
Smaller part / Full part * 100
For example,
25/75*100 = 33.333
(3rd edit) Thank you been trying some new things and got it fully working but the only thing Im struggling to figure out is conversion. I would like to convert Score,Score2, and TotalScore back to a int after the calculations to send ints in the SetTriggerText instead of floats.
Idk what happened but the first code did not say a error for me at first. Here is a function Divide where you can divide 2int and get a int back. So you can keep score and score2 as int.
I implemented what you gave and got no errors but on the ScoreText4 (To display the Percent) i just get 0 and it seems Score2 is getting the same value as Score but TotalScore and Score seem to work fine.
Edit: Just a little mistake on the scores getting the same values (i fixed that) but for the percent i just get 1 or a not correct percent but all other values are good still.
if you want to have the percentage in float here is the same function but return as a float (you cant have both without changing the name of one of them)