How to set the same pivot in a scirpt for diffrenet 3d models

so i have many 3d models that need to have the same pivot but i dont know how to set it , change it in scirpt? i used PivotTo() it didn’t work
and the pivot offset wouldn’t be a lot of help
like here, I set the CFrame of these guns to the same CFrame, but they look different because of the pivot, in a script

I would think pivot offset would be the best way to fix this, but if that isn’t working, here are some other things to try:

  1. (probably the best way) Give each model a cframe attribute (You don’t need to store the cframe in an attribute, I just think it’s the most easy way to do this) to store the pivot offset of each gun. Then when you set the cframe of each model, add the pivot offset attribute to the original cframe.
  2. Add an invisible part to your models and make that part the primary part, you can then adjust this part to adjust the pivot offset.

This should hopefully solve your problem, if it doesn’t, just tell me, and I can try to help you. Also, there may be an easier way to do this, like maybe there is a way to get pivot offset to work, so these are just some reliable solutions, but maybe not the best.
I hope this helps!

1 Like

i will try these out and if they didn’t work i would tell you , tysm :heart:

1 Like
--ServerScript in ServerScriptService
root.CFrame = CFrame.new(0, 0, 0) * CFrame.fromOrientation(0, math.rad(90), 0)

Last part of that can set all the angles with math.rad().

or just

root.CFrame = CFrame.fromOrientation(0, math.rad(90), 0)
1 Like