LocalWE
(WilliApple)
February 27, 2021, 7:27am
#1
Hello developers! I need help with my part. It is not tweening.
The code
local ts = game:GetService("TweenService")
local part = script.Parent
local goal = {}
goal.Orientation = Vector3.new(0, -120, 0)
local twi = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false)
local tween = ts:Create(part, twi, goal)
game.ReplicatedStorage.RotateCam.OnServerEvent:Connect(function()
tween:Play()
end)
Solutions I tried already
If you can help, please let me know. Thanks, WE
sjr04
(uep)
February 27, 2021, 7:29am
#2
Where is this server script located ? Are any exceptions thrown in the output?
LocalWE
(WilliApple)
February 27, 2021, 7:29am
#3
No errors, and the script is inside of the part that I want tweened.
Before position:
Video:
EXM_0
(yuno)
February 27, 2021, 7:39am
#4
Why not just put the Tween information inside the function?
LocalWE
(WilliApple)
February 27, 2021, 7:41am
#5
Doesn’t make a difference…
local ts = game:GetService("TweenService")
local part = script.Parent
game.ReplicatedStorage.RotateCam.OnServerEvent:Connect(function()
local goal = {}
goal.Orientation = Vector3.new(0, -120, 0)
local twi = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false)
local tween = ts:Create(part, twi, goal)
tween:Play()
end)
Tomatoe_s
(Tomatoe_s)
February 27, 2021, 7:41am
#6
It looks like it would work fine, try checking if the part is welded to something?
EXM_0
(yuno)
February 27, 2021, 7:42am
#7
Then maybe the part is Unachored?
LocalWE
(WilliApple)
February 27, 2021, 7:43am
#8
No the part is anchored.
@Tomatoe_s , the part had a Hinge for the camera, which gets destroyed in game so I know where the camera is. There are no welds at all… CanCollide is even turned off.
script.Parent.FrontSurface = Enum.SurfaceType.Smooth
script.Parent.Transparency = 1
EXM_0
(yuno)
February 27, 2021, 7:43am
#9
Did you already check if the function actually did run?
1 Like
LocalWE
(WilliApple)
February 27, 2021, 7:45am
#10
Added some prints, and yes it does run and go all the way to the end
local ts = game:GetService("TweenService")
local part = script.Parent
game.ReplicatedStorage.RotateCam.OnServerEvent:Connect(function()
print("Ran")
local goal = {}
goal.Orientation = Vector3.new(0, -120, 0)
local twi = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false)
local tween = ts:Create(part, twi, goal)
tween:Play()
print("Finished")
end)
Also, I used this method of Tweening multiple times, for numerous different reasons, and it doesn’t seem to work this time for this…
Tomatoe_s
(Tomatoe_s)
February 27, 2021, 7:49am
#11
Used the exact same script as you, works fine for me.
Are you sure its not the camera script?
EXM_0
(yuno)
February 27, 2021, 7:49am
#12
I tested the script, it worked for me. Try increasing the time or replce goal with { Orientation = Vector3.new(0, 0, 180) }. And also check if the part actually Tweened, might be a camera problem as Tomatoe_s said.
LocalWE
(WilliApple)
February 27, 2021, 7:58am
#13
Yea I completely forgot the camera existed…