Hello, so I scripted an in-game store where you can buy pets using currency obtained from the game, however, I am experiencing an issue that I cannot figure out how to correct, even after doing proper research on this topic.
My issue is that when the pet is equipped, the rotation of the part remains on the incorrect side which I believe is due to the mesh being oriented the incorrect way. I am using meshes created by ROBLOX for this store.
I tried to rotate the part which the store clones and gives it to the player.character, which is located under replicated storage. I am very confused as to how to correct this issue and have attached an image for an example.
if pet ~= nil and hum ~= nil and head ~= nil then
if hum.Health >= 0 then
local cf = head.CFrame * CFrame.new(3,-2.5+fl,3)
pet.BodyPosition.Position = Vector3.new(cf.x,cf.y,cf.z)
pet.BodyGyro.CFrame = head.CFrame * CFrame.new(3,0,-0)
else
break
end
end
end
Correct, you are. What that means is that we have to rotate your body gyro using CFrame.Angles(). It’s gonna be a 90 degree rotation in one of the 3 axes depending on your mesh. It’ll look something like