Hi i have this wieird problem with this script. Maybe someone can help me solved it.
Well a have a random number, the first time i run (o[inicio]) i put an object in some position, then when is not the first time i change the position in Y of the object without changing X and Z. So i wrote this script.
Y = random.uniform(-15, 38)
print(“originalY”,Y)
if not o[“inicio”]:
print("newY", Y + 38.620)
mira1.position = [mira1.position[0], Y+38.620 , mira1.position[2] -4]
print("afterPos",mira1.position)
else:
o["inicio"] = False
print("Ybefore",Y + 38.620)
mira1.position = [-10.045, Y+38.625, -1.940]
print("beforePos",mira1.position)
the output, its weird because i ran the script. First line the value of the random Y. Ybefore is Y+38.620. And finally i have a position. But heres one problem mira1.position = [-10.045, Y+38.625, -1.940] but in this case is [-9.9876134824752807, 2.0657463645935059, 2.0657463645935059] ok in X isnt too much difference. in Y is a very huge different the position in Y should be 74.439802493835373 but is 2.0657463645935059, and in Z is a little difference it should be -1.940 but is 2.0657463645935059.
(‘originalY’, 35.819802493835383)
(‘Ybefore’, 74.439802493835373)
(‘beforePos’, [-9.9876134824752807, 35.412167758727961, 2.0657463645935059])
(‘originalY’, 1.5803624490442125)
(‘newY’, 40.200362449044206)
(‘afterPos’, [-9.9302269649505615, 1.1677277139367845, 2.0714927291870118])
someone know why it happen?