Hello, I want to tween a client sided object for 1 client. However, my original code isn’t working.
It’s fired by a remote event by the server if a player touches a part.
Code:
local part = game.ReplicatedStorage.Part:Clone()
part.Parent = workspace
part.Position = workspace.TargetPartEffectPosition
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
local tween = TweenService:Create(part, tweenInfo, {Size = Vector3.new(20, 20, 20)})
tween:Play()
part:Destroy()
The problem here is that you are literally destroying the part the moment you tween it, so yes it starts tweeting but then it gets destroyed. Try this:
local part = game.ReplicatedStorage.Part:Clone()
part.Parent = workspace
part.Position = workspace.TargetPartEffectPosition
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
local tween = TweenService:Create(part, tweenInfo, {Size = Vector3.new(20, 20, 20)})
tween:Play()
tween.Completed:Wait()
part:Destroy()