thats weird, i think your code should work. Maybe its the laser object itself
anyway heres code i made that should work
local part = script.Parent
local originSize = part.Size
local originPos = part.Position
local deltaSize = Vector3.new(0,0,5)
local deltaPos = Vector3.new(0,0,10)
local info = TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,-1,true,0)
local goals = {Size = originSize + sizeChange, Position = originPosition + sizeChange/2 + positionChange}
local myTween = game:GetService("TweenService"):Create(part, tweenInfo, tweenGoal)
myTween:Play()
PS. its moving on video because i assume you wanna make the laser move. if you dont, set deltaPos to zero. the 1-sided growth is already pre-calculated for in tweengoals
Is welding an invisible part a viable solution? Whenever the part moves, it will move accordingly. It’s kind of cheap but I don’t see why it can’t work.
If this isn’t viable, I can go find where I’ve done something similar.
oh sorry.
to make the tween relative, you have to use Position = CFrame:PointToWorldSpace(deltaSize/2 + deltaPos) as this creates your vector relative to the objects CFrame.
local part = script.Parent
local originSize = part.Size
local originCFrame = part.CFrame
local deltaSize = Vector3.new(0,0,5)
local deltaPos = Vector3.new()
local info = TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,-1,true,0)
local goals = {Size = originSize + deltaSize, Position = originCFrame:PointToWorldSpace(deltaSize/2 + deltaPos)}
local myTween = game:GetService("TweenService"):Create(part, info, goals)
myTween:Play()
Currently, you’re tweening the “Position” property of the part which describes its position relative to the world space by translating it 25 studs along the X-axis, this translation occurs respective to the world space as orientation of the part isn’t being accounted for. To tween the part’s position relative to its current orientation in the world space then you’ll need to tween its “CFrame” property instead as it holds both positional and orientational data pertaining to the part relative to the world space. To translate the part 25 studs along the X-axis simply multiply (since we’re working with scalars, when multiplying scalars the values are essentially added) its “CFrame” property by a constructed CFrame value using the CFrame class constructor function (CFrame.new()) which just holds this 25 stud X-axis offset.