Hello, I’m trying to spin and move my model at the same time. I’ve tried spinning it around, it works, and so does moving it. But the problem is, I can’t get it to work at the same time (moving and spinning both happening at once).
Model: (Has a PrimaryPart set, both handles are welded to the invisible ‘‘part’’)
Current Script inside of the PrimaryPart (part):
local tweenService: TweenService = game:GetService("TweenService")
local part: Part = script.Parent
local tweenInfo0: TweenInfo = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
-1,
true
)
local tweenInfo1: TweenInfo = TweenInfo.new(
5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
-1,
true
)
tweenService:Create(part, tweenInfo0, {CFrame = part.CFrame + Vector3.new(0, 1, 0)}):Play()
tweenService:Create(part, tweenInfo1, {Orientation = Vector3.new(0, 360, 0)}):Play()
Result:
How’d I go about fixing this absolute spinning madness?
i dont think you made any errors cause the actual primary part looks fine ingame but anything welded to it looks so spinny
dont take my word for it tho i might be wrong
yeah it didnt change anything also btw the actual part is working fine and i think its the welds cause when i weld stuff to it they go crazy
i have no idea to fix this
Cant u just use :PivotTo() instead? like in a loop
while true do
task.wait()
local part = script.Parent
part:PivotTo(part.CFrame * CFrame.Angles(0, math.rad(1) ,0)
--if u need to pivot a model then use this
--part:PivotTo(part:GetPivot() * CFrame.Angles(0, math.rad(1) ,0)
end
I would just Recommend you use RunService.RenderStepped for this occasion rather than just using TweenService as an answer to all your problems.
Because this isnt a detail that should be prioritized by the game, it should just taken care of by the Client as an Animation of sorts. What RenderStepped will do here is fire everytime in every frame, prior to physics and I believe prior to Rendering as well, but using this can make the object smoothly rotate along an axis, I would also recommend you utilize CollectionService for this as well, as it will make it easier to control what will be aninated, and what will not.
Tweens will fire constantly, which is why you will see a smooth transition along its path, but because of that, they send a lot of data, one single Tween will not affect your game, but hundreds will slow it down because of the data its sending.