Help with CFrame

Im trying to read the cframe of some parts but when i get the cframe the orientation is not what i set in explorer and is varied between each part even though when i look in explorer they all say they have the same orientation.


if anyone knows how to fix this wierd issue that would be a huge help.

I don’t think that is a major issue. I believe that it is happening because the orientations are stored as floating point variables which means that they aren’t 100% accurate. It’s like this equation.

0.1 + 0.2 = 0.30000000000000004

Computers mess up rounding, sometimes. But the amount is negligible. It will prevent you from checking orientations to one another, to see if they’re the same.

It is messing up the orientation of my models, (im getting a random knife and setting each of them to the cframes on the board).

The properties window rounds up values as such so they don’t display the float point precision errors. You can get rid of the errors by using math.floor or math.ceil. (math.round works too)

print(math.floor(number * 10) / 10)

You should just set the orientation of every knife object. Then you cna just use position, instead of having to fiddle with orientaton

unfortunately this didnt work as for some reason when i rounded it and then created the cframe it swapped the x and z axis around and made it positive when its supposed ti be negative for NO reason

turns out the issue with the script was just that i didnt realise that Scripts in the Client RunContext still run when in ReplicatedStorage which was causing the script to run twice.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.