Hi
I have a player which is a little to big for the scene so I manually scaled him down to scale with a boat.
However, the boat walks walkable scaling 70/50.
So I did this:
function repeatedly_execute_always() {
cTurner.Scaling=cSpeedBoat.Scaling/2;
}
}
Is there a way to turn this into a float like /2.2?
Cheers ;)
Since Character.Scaling is an int property, you cannot do floating point math directly.
But you can do either:
function repeatedly_execute_always() {
cTurner.Scaling=(cSpeedBoat.Scaling*50)/70; //Remember the multiplication MUST be done before the division.
}
or alternatively:
function repeatedly_execute_always() {
cTurner.Scaling=Maths.FloatToInt(Maths.IntToFloat(cSpeedBoat.Scaling)/1.4, eRoundNearest);
}
The results of the two methods should be more or less the same, save for some rounding differences.
(Note: This was written when your post wasn't edited yet, hence the 1.4 and not 2.2 .)
Thanks Gilbert (nod)