#Help with rotating a welded model
1 messages · Page 1 of 1 (latest)
local pet = script.Parent
game:GetService("RunService").Heartbeat:Connect(function(dt)
pet.PrimaryPart.CFrame *= CFrame.Angles(0, math.rad(100 * dt), 0)
end)
wait()is bad, usetask.wait()instead
- here using
RunService.Heartbeatis better because you can use delta time to make the model spin at a constant rate regardless of lag
did you weld all the models parts to the primary part
- you have to set the cframe for welds to work
if its something like a spinning platform and you want players that stand on it to rotate with it, you have to use physics
it's a spinning pet. unrelated to physics
alr
You should use cframes and HiLock said
pet.PrimaryPart.CFrame = CFrame.new(pet.PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ(0,5,0)) this errors. what's the right way to do it?
local pet = script.Parent
game:GetService("RunService").Heartbeat:Connect(function(dt)
pet.PrimaryPart.CFrame *= CFrame.Angles(0, math.rad(100 * dt), 0)
end)
local pet = script.Parent
game:GetService("RunService").Heartbeat:Connect(function(dt)
pet.PrimaryPart.CFrame *= CFrame.Angles(0, math.rad(100 * dt), 0)
end)
do i have to put a red circle around it
same problem. head moves(primary part) and the rest isn't moving
are you sure it's all welded
yes
and only the primary part is anchored
the primary part isn't anchorede
Can't u pivot it
nothing is anchored it's in a viewport frame
local pet = script.Parent
game:GetService("RunService").Heartbeat:Connect(function(dt)
pet:PivotTo(pet:GetPivot() * math.rad(100*dt))
end)
would it not fall?
also yeah in that case just pivot it
i don't think welds work in a viewportframe
:3: invalid argument #2 (Vector3 expected, got number)
send code
local pet = script.Parent
game:GetService("RunService").Heartbeat:Connect(function(dt)
pet:PivotTo(pet:GetPivot() * math.rad(100*dt))
end)
???
I don't thinks it's how rotate cframe