Help with lazer eyes

So right now, the lazer resizes on both size which I don’t want. I don’t know how to tween the cframe to the center of half the size to tween.

local raycastLazerEyesMaxRange = 1000

local leftDirection = (target.Position - origin).Unit * raycastLazerEyesMaxRange

local leftCenter = lazer.Position + leftDirection / 2
local leftDistance = leftDirection.Magnitude

lazer.CFrame = CFrame.lookAt(lazer.Position, target.Position)

local tweenData = {
	Size = Vector3.new(lazer.Size.X, lazer.Size.Y, leftDistance),
	CFrame = ???,
}

local leftSizeTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local leftSizeTween = TweenService:Create(lazer, leftSizeTweenInfo, tweenData)
leftSizeTween:Play()

Result:

I want it like this:

1 Like
local tweenData = {
	Size = Vector3.new(lazer.Size.X, lazer.Size.Y, leftDistance),
	CFrame = CFrame.lookAt(lazer.Position:Lerp(target.Position,0.5), target.Position),
}

Doesn’t seem to work.

CFrame = CFrame.new(lazer.Position:Lerp(target.Position, 0.5), target.Position),

I want to cframe to the center of the origin and the target.

local tweenData = {
	Size = Vector3.new(lazer.Size.X, lazer.Size.Y, leftDistance),
	CFrame = CFrame.lookAt(leftCenter, target.Position),
}

It works but this happens:

This should works.

local tweenData = {
	Size = Vector3.new(lazer.Size.X, lazer.Size.Y, leftDistance),
	CFrame = CFrame.lookAt(leftCenter, origin + leftDirection)

}

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.