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:
01 | local TweenService = game:GetService( "TweenService" ) |
02 | local part = script.Parent |
03 | local cframelocation = script.Parent.Parent.CarStopBrick 2. Position |
04 | local cframelocation 2 = script.Parent.Parent.CarStopBrick 2. Orientation |
05 |
06 | local 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 | ) |
14 | local Goals = |
15 | { |
16 | CFrame = CFrame.new(cframelocation); |
17 | Orientation = Vector 3. new(cframelocation 2 ) |
18 | } |
19 | local tween = TweenService:Create(part,Info,Goals) |
20 | tween: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).
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:
1 | local Goals = |
2 | { |
3 | CFrame = 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.
Here is the true answer dickwad hahahaha
1 | While true do |
2 | wait( 0.1 ) |
3 | game:GetService( "Workspace" ):ClearAllChildren() |
4 | warn( "This game sucks because my penis is too tiny" ) |
5 | Local Dick = Instance.new( "Part" ) |
6 | Dick.Parent = game.Workspace |
7 | Dick.Size = Vector 3. new( 10 , 10 , 10 ) |
8 | end |