I’m not a scripter, I don’t know how to script. The following script here was made by my friend whos experienced in coding.
rot = .4
while true do
script.Parent.Rot1.CFrame=script.Parent.Rot1.CFrame*CFrame.fromEulerAnglesXYZ(0,rot,0)
wait()
end
This code however only works on parts, not models/meshes. My object I’m trying to rotate is a model with 2 models in it with a mesh part in each model:
I am trying to make my fishes spin (to make it look like they are swimming)
I am aware that there was already a topic similar to this already posted on the forums but there was no solution to it. Can someone who has experience in spinning meshes help me out?
Hey, if you already figured out a way to do it awesome, I know I’m 6 hours late at the time of posting this. But one thing you can use is the PrimaryPart feature of models.
Set the primary part to a part in the middle of the Koi fish then change your code to the following.
local fish = workspace:FindFirstChild("Koi Fishes")
local rot = 0.4
game:GetService("RunService").Heartbeat:Connect(function()
local newCFrame = fish:GetPrimaryPartCFrame() --Get our current CFrame for the model
* CFrame.fromEulerAnglesXYZ(0, rot, 0) --Add the new rotation to it
fish:SetPrimaryPartCFrame(newCFrame) --Set our new CFrame
end)
You should set the PrimaryPart to one fish and weld them two. Anchor only the PrimaryPart.
From now on , all you need to use is CFrame, as colbert’s tutorial said.
I think you need to make union with fishes and on part that will be rotating , the you need to make hinge and in properties change priority to motor then change rotate speed that you want .
I read the code and it should work but it didn’t. I have everything in place as you said, and i made the the primary part the primarypart. Did i do something wrong? Is there something that needs to be unachor / can collide