I keep getting a tweening error

  1. What do you want to achieve? Keep it simple and clear!
    I want to part to tween based on the properties listed in the script. I’m also just learning how to tween
  2. What is the issue? Include screenshots / videos if possible!
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve searched on youtube for solutions.
local tweenService game:GetService("TweenService")
local part = script.Parent

local tweeningInfo = TweenInfo.new(
	5, -- Length

local partProperties = {
	Size = Vector3.new(20,20,20);
	Color = Color3.new(255, 0, 0);
	Transparency = 0.5

local Tween = tweenService:Create(part,tweeningInfo,partProperties)

Thank you!

1 Like

This is a code from the guide forum

 local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Color = Color3.new(1, 0, 0)
 part.Anchored = true
 part.Parent = game.Workspace
 local goal = {}
 goal.Position = Vector3.new(10, 10, 0)
 goal.Color = Color3.new(0, 1, 0)
local tweenInfo = TweenInfo.new(5)
 local tween = TweenService:Create(part, tweenInfo, goal)

as you see it uses local goal = {} with the {} and not with the entire things (i’m not use if this fixes the problem but give it a try)

You forgot an equals sign after the variable so the tweenService variable was never created.

:man_facepalming:I’m so dumb lol. I will test it out now and let you know if it works. Thanks.

Edit: Yep it works, thanks!

1 Like