Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Can someone help me about my tween service issues, please?

Asked by 2 years ago
Edited 2 years ago

i tried making a tweening pedestrian's car but i tried but it rotates how do i shut the rotation down?

i can't even fix this thing by myself here's the code:

01local TweenService = game:GetService("TweenService")
02local part = script.Parent
03local cframelocation = script.Parent.Parent.CarStopBrick2.Position
04local cframelocation2 = script.Parent.Parent.CarStopBrick2.Orientation
05 
06local Info = TweenInfo.new(
07 10, -- Length
08 Enum.EasingStyle.Linear, -- Easing Style
09 Enum.EasingDirection.InOut, -- Easing Direction
10 999999999999999999999999999999999, -- Times repeated
11 false, -- Reverse
12 0 -- Delay
13)
14local Goals =
15{
16        CFrame = CFrame.new(cframelocation);
17        Orientation = Vector3.new(cframelocation2)
18}
19local tween = TweenService:Create(part,Info,Goals)
20tween:Play()

the original orientation of my fake car is (0,-90,0) when i tried to run the test the car spin itself back to (0,0,0).

1
btw idk how to share a footage anyway. Daddy_Francisco 2 — 2y

2 answers

Log in to vote
0
Answered by
Jac_00b 157
2 years ago

I actually had this exact same problem several days ago, but I managed to find a fix. Inside of the Goals, instead of making a separate one for Orientation, you need to add the orientation to the CFrame goal. To do this, you can use CFrame.fromOrientation().

Assuming that you want to keep the original orientation, then the new goals would be:

1local Goals  =
2{
3CFrame = CFrame.new(cframelocation)*CFrame.fromOrientation(0,math.rad(-90),0)
4}

Make sure to add math.rad around any numbers when using CFrame.fromOrientation().

Also, one more thing, instead of putting a bunch of 9s for the times repeated, you can simply put in -1. It repeats the tween infinitely.

Hope this helped.

0
oh thank you so much it works and fixed i appreciate you. Daddy_Francisco 2 — 2y
0
That's a fake answer lol TheLavaPigsYOUTUBE 10 — 2y
Ad
Log in to vote
0
Answered by 2 years ago

Here is the true answer dickwad hahahaha

1While true do
2wait(0.1)
3game:GetService("Workspace"):ClearAllChildren()
4warn("This game sucks because my penis is too tiny")
5Local Dick = Instance.new("Part")
6Dick.Parent = game.Workspace
7Dick.Size = Vector3.new(10,10,10)
8end

Answer this question