first of all, im trying to make a gaster blaster which shoots a beam apon spawning, only problem is that its very hard to attack the beam to one place,
local TweenService = game:GetService("TweenService")
local part = script.Parent
local function blast(part)
local beam = part.Beam
local sizedata = 100
beam.CFrame = part.CFrame
beam.Size = beam.Size + Vector3.FromAxis(Enum.Axis.Z) * sizedata
beam.Position = part.Position + Vector3.FromNormalId(Enum.NormalId.Left) * sizedata / 2
local sizeTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local sizeTweenGoal = {Size = beam.Size + Vector3.FromAxis(Enum.Axis.Z) * sizedata}
local sizeTween = TweenService:Create(beam, sizeTweenInfo, sizeTweenGoal)
local positionTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local positionTweenGoal = {Position = part.Position + Vector3.FromNormalId(Enum.NormalId.Left) * sizedata / 2}
local positionTween = TweenService:Create(beam, positionTweenInfo, positionTweenGoal)
sizeTween:Play()
positionTween:Play()
sizeTween.Completed:Wait()
positionTween.Completed:Wait()
end
blast(part)