How would i rotate a grouped modle slowlyy

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    a Smooth turn like shown in https://driftboss.io/

  2. What is the issue? Include screenshots / videos if possible!
    i cant find how to rotate a modle smoothly it only rotates 1nce and if i repeate the movment it goes back and forth

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    ive tryed adding vector 3 for example local PrimCFrame = script.Parent:GetPrimaryPartCFrame()
    local Rotation = CFrame.Angles(math.rad(0),0.1,0) + Vector3.new(0,0.5,0)
    local RotatedCFrame = PrimCFrame * Rotation
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Over = true
local Under = true
game.ReplicatedStorage.ButtonDown.OnServerEvent:Connect(function()
	--Rotation variables
	local PrimCFrame = script.Parent:GetPrimaryPartCFrame()
	local Rotation = CFrame.Angles(math.rad(0),0.1,0)
	local RotatedCFrame = PrimCFrame * Rotation
	--Rotation variables
	Over = true
	Under = true
	repeat
		wait(0.5)
		print(script.Parent.RotationPart.Rotation.Y)
		-- detects the rotation
		if script.Parent.RotationPart.Rotation.Y >-91 then
			Under = false
		end
		if script.Parent.RotationPart.Rotation.Y <-89 then
			Over = false
		end
		-- detects the rotation
		script.Parent:SetPrimaryPartCFrame(RotatedCFrame)--rotates
	until Over == false and Under == false
	print("Over")
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

2 Likes

Here is a workspace

Also thanks for any help you all are amazing :heart:

1 Like

Please show what you expect by taking a video of you playing the game, not an offsite game link.

1 Like

im sorry my computer wont upload vidios ive tryed

take a part make set rotation to 0.5 and rotate it i want that but with a model

1 Like

I recommend using tween service for this. something like this

TweenService = game:GetService("TweenService")
spininfo = TweenInfo.new(2,Enum.EasingStyle.Linear) -- the 2 determines how long it will take to rotate

Spin1 = TweenService:Create(script.Parent,spininfo,{CFrame = script.Parent.CFrame * CFrame.Angles(0,math.rad(120),0)})

Spin1:Play()
1 Like

I get the error CFrame is not a valid member of Model “Workspace.Car” - Server - Script:4

Use :GetPivot() instead of .CFrame for a model.

Will try to do that ty (Character Limmmit)

this should work

local TweenService = game:GetService("TweenService")

local object = script.Parent

local TweenValue: CFrameValue = object.TweenValue
TweenValue.Value = object:GetPivot()

local Info = TweenInfo.new() -- all defaults

local Tween = TweenService:Create(TweenValue, Info, {Value = object:GetPivot()*CFrame.Angles(0, math.pi/2, 0)})

TweenValue.Changed:Connect(function()
	object:PivotTo(TweenValue.Value)
end)

task.wait(5)

Tween:Play()

the tween value is a CFrame Value
image

i have a lead with the :getpivot im curently implementing it into a script ima use in game it should work
ty for the help though hutcle

1 Like

Works great ty everyone who helped and if your wondering

game.ReplicatedStorage.ButtonDown.OnServerEvent:Connect(function()
for i = 1, 5 do
script.Parent:PivotTo(script.Parent:GetPivot() * CFrame.Angles(0, math.rad(-18), 0))
wait(0.00000001)
end
end)
game.ReplicatedStorage.ButtonUp.OnServerEvent:Connect(function()
for i = 1, 5 do
script.Parent:PivotTo(script.Parent:GetPivot() * CFrame.Angles(0, math.rad(18), 0))
wait(0.00000001)
end
end)
is my script

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.