Rotate Motor6D using Tween

Hello I was able to make this rotate but its always resetting it to the default value, is there a way to make this script smoothly tween and loop perfectly?


local tweenService = game:GetService("TweenService")
local changes = {
	C0 = motor.C0 * CFrame.Angles(0,math.rad(180),0)
}

local tweenInfo = TweenInfo.new(
	2,									-- Time taken for a full animation
	Enum.EasingStyle.Quad,			-- Animation Style
	Enum.EasingDirection.InOut,			-- Animation Type
	-1,									-- Number of repeats (-1 is infinite)
	false,								-- Reverse?
	0-- Delay between animations
)

local tween = tweenService:Create(motor, tweenInfo, changes)

tween:Play()

I know this is not helping, but I really like your effects. They are cool.

1 Like

Why don’t you change the math.rad(180) to math.rad(360)?

1 Like

i tried but, no luck it just doesn’t move at all…

thank you, I’m currently making these to submit them to Evade since they recently made an Unusual’s update.

1 Like

Tween it a second time? asdghajsgawdkasf

1 Like

Epic. How would you even submit it to them anyway?

1 Like

hah!, i thought about that aswell, just couldn’t make a proper loop cuz i haven’t done code in so long

1 Like

their server, you can get a role to submit them, check their game and the server should be there

1 Like

Just do tween:Play() twice lol (I think that might work O_O)

1 Like

if only it was that easy, it chokes since the last one hasn’t finished, just doesn’t work that way in general

Here’s something that may help:

1 Like
local tweenService = game:GetService("TweenService")
local changes1 = {
	C0 = motor.C0 * CFrame.Angles(0,math.rad(180),0)
}
local changes2 = {
	C0 = motor.C0 * CFrame.Angles(0,math.rad(360),0)
}

local tweenInfo = TweenInfo.new(
	2,									-- Time taken for a full animation
	Enum.EasingStyle.Quad,			-- Animation Style
	Enum.EasingDirection.InOut,			-- Animation Type
	-1,									-- Number of repeats (-1 is infinite)
	false,								-- Reverse?
	0-- Delay between animations
)

local tween1 = tweenService:Create(motor, tweenInfo, changes1)
local tween2 = tweenService:Create(motor, tweenInfo, changes2)

tween1:Play()
tween2:Play()

I don’t know what I was really thinking about when doing this…

1 Like

it didnt do anything, sorry bud, ill try the one above instead and see if it works

thank you very much, here’s the code I used

local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local angle = Instance.new("NumberValue")


local tweenInfo = TweenInfo.new(
	1,									-- Time taken for a full animation
	Enum.EasingStyle.Linear,			-- Animation Style
	Enum.EasingDirection.InOut,			-- Animation Type
	-1,									-- Number of repeats (-1 is infinite)
	false,								-- Reverse?
	0-- Delay between animations
)

RunService.Heartbeat:Connect(function()
    motor.C0 = CFrame.new(motor.C0.Position) * CFrame.Angles(0, math.rad(angle.Value), 0)
end)

TweenService:Create(angle, tweenInfo, {
    Value = 360;
}):Play();
1 Like

Why script anyway? Why don’t you use Torque? (or something. I know nothing about Motor6D, Angular Velocity, Torque, Constraints, etc.)

idk why dont you try that and tell me how it goes