How would I create an effect like this?

How would I create an effect like this?
image

Solutions I have tried: making the projectile face the center of the ball.
This was my outcome:

My code:

while wait(.1) do
	local laserclone = game.ReplicatedStorage.objects.Laser:Clone()
	laserclone.Parent = workspace.BossObjects
	local AttachmentPosition = script.Parent.Attachment.WorldPosition
	local RandomPosition = AttachmentPosition + Vector3.new(math.random(-60,60), math.random(0,20), math.random(-60,60))
	
	laserclone.CFrame = CFrame.new(AttachmentPosition, AttachmentPosition+Vector3.new(0,1,0))
	
	game.TweenService:Create(laserclone, TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0), {Position = RandomPosition, Transparency = 1}):Play()
end
2 Likes

You want to tween the CFrame | Roblox Creator Documentation not position

Cframe.new(BlastOrigin,Outwards) something like that

Could you possibly go more into depth? What variables should I use in the CFrame when tweening?

Once you set the part to look in the outward direction you index Cframe.LookVector and you go along that vector for your tween

Like this?

CFrame = CFrame.new(RandomPosition, laserclone.CFrame.LookVector)

Sorry if I am annoying you, I’m not very good with CFrame but I appreciate you helping me out.

You want to use this CFrame.new ( Vector3 pos, Vector3 lookAt )

The first parameter is Parts Position Second is where the part is looking towards. In your case it would be Cframe.new(Lazerclone.Position,Blast.Position)

local OutwardCFrame = Cframe.new(Lazerclone.Position,Blast.Position):inverse()
-- Variable is The Lazer looking towards blast it shot out then inversed

-- then you will tern along the lookvector of that cframe
while wait(.1) do
	local laserclone = game.ReplicatedStorage.objects.Laser:Clone()
	laserclone.Parent = workspace.BossObjects
	local AttachmentPosition = script.Parent.Attachment.WorldPosition
	local RandomPosition = AttachmentPosition + Vector3.new(math.random(-60,60), math.random(0,20), math.random(-60,60))

	laserclone.CFrame = CFrame.new(AttachmentPosition, RandomPosition)
	local OutwardCFrame = CFrame.new(laserclone.Position,RandomPosition):inverse()
	game.TweenService:Create(laserclone, TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0), {CFrame = CFrame.new(RandomPosition,OutwardCFrame.LookVector)}):Play()
end

Is this correct?

No i was going to make an example but looking at your script you haven’t defined the position the projectile landed

It would look something like this

local OutwardCFrame = Cframe.new(Lazerclone.Position,Blast.Position):inverse()

laserclone.Position = RandomPosition
laserclone.CFrame = OutwardCframe

local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0)
local Goal = {Cframe =laserclone.Cframe * CFrame.new(0, 0, -5)} --// This should move it 5 studs forward 
-- maybe backwards just test (._.'

game.TweenService:Create(laserclone, tweenInfo,Goal):Play()

RandomPosition is the final position the laser should go to, and attachmentposition is where it starts

If that’s the case then. It would look something like this…

local OutwardCFrame = Cframe.new(AttachmentPosition,RandomPosition):inverse()

laserclone.Position = AttachmentPosition
laserclone.CFrame = OutwardCframe

local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0)
local Goal = {Cframe =laserclone.Cframe * CFrame.new(0, 0, -5)} --// This should move it in the look direction of the random position 
-- 5 studs forward  I think or maybe backwards just test

game.TweenService:Create(laserclone, tweenInfo,Goal):Play()