Getting center of mass of a model

Oh I haven’t solved the problem yet. I understand that multiplying the vector3 by the decimal is the issue, but what do you think I can do about this? The code loops through the whole number mass to add in that mass priority thing, and it just leaves the extra decimal in the mass to be divided by. I can’t run a loop ‘decimal’ times to do the same thing, but I can’t forget about that extra decimal in the mass or it won’t be perfect.

So is the loop running too many times? Or too little.

Actually, I think I found the issue.

For

num += 1
mass += (v.Position*decimal)

I only multiplied v.Position by the decimal, not the total deviser. If I do

num += 1*decimal

, then it should work.

Annnnnddd. It works!
image

1 Like

Coding is confusing, it is 1*decimal then it shouldn’t change but apparently not. But I am glad to see it works! Sorry I wasn’t much help.

1 Like

You did help. Having conversations and discussions does help solving it!

1 Like

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