Hello, I am trying to rotate and move a model at the same time, but it only moves it.
Here is my script:
local RunService = game:GetService("RunService")
while true do
for i = 1, 100 do
RunService.Heartbeat:Wait()
script.Parent:SetPrimaryPartCFrame(CFrame.new(script.Parent.PrimaryPart.Position + Vector3.new(0,.5, 0)) * CFrame.Angles(0, math.rad(1), 0))
end
for i = 1, 100 do
RunService.Heartbeat:Wait()
script.Parent:SetPrimaryPartCFrame(CFrame.new(script.Parent.PrimaryPart.Position - Vector3.new(0,.5, 0)) * CFrame.Angles(0, math.rad(1), 0))
end
end
It looks like you are trying to make the pickup able item effect.
The issue here is that the previous CFrame is not taken accounted for and is being set a static CFrame.angles value. Another issue is using set primary part CFrame which I discourage as it can get buggy overtime for this scenario see within engine bugs