I’ve used this to code; (KEEP IN MIND IT’S JUST A PORTION OF THE CODE AND EVERYTHING WORKS FINE)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local VFX = ReplicatedStorage.Assets.VFX
local Beam = VFX.Goku.Beam:Clone()
Beam.Name = "Beam"..Character.Name
Beam.Parent = workspace.World.Visuals
Beam.Inner.Position = HumanoidRootPart.CFrame.LookVector*11 + Vector3.new(0,3.25,0)
Beam.Outer.Position = Beam.Inner.Position
Beam.Inner.Orientation = HumanoidRootPart.Orientation + Vector3.new(0,90,0)
Beam.Outer.Orientation = HumanoidRootPart.Orientation + Vector3.new(0,90,0)
TweenService:Create(Beam.Inner,TweenInfo.new(.08),{Size = Beam.Inner.Size + Vector3.new(45,0,0), Position = Beam.Inner.Position + HumanoidRootPart.CFrame.LookVector*22}):Play()
TweenService:Create(Beam.Outer,TweenInfo.new(.08),{Size = Beam.Outer.Size + Vector3.new(45,0,0), Position = Beam.Outer.Position + HumanoidRootPart.CFrame.LookVector*22}):Play()
To position the Beam at The HumanoidRootParts LookVector but it does this and positions itself no where close to the players HumanoidRootPart ;
Could someone please help.
ayoub50
(Ayoub)
#2
i see that the beam is spawing in the spot where the player has first spawned.
Fraudsstar
(Fraudsstar)
#3
Yeah I’ve realised that the beam spawns in the Workspace Origin Position which is 0,0,0 but I don’t know how to fix it
Try changing this
Beam.Inner.Position = HumanoidRootPart.CFrame.LookVector*11 + Vector3.new(0,3.25,0)
Beam.Outer.Position = Beam.Inner.Position
to this
Beam.Inner.Position += (HumanoidRootPart.CFrame.LookVector*11 + Vector3.new(0,3.25,0))
Beam.Outer.Position = Beam.Inner.Position
gertkeno
(Gert)
#5
You need to add the character’s offset to the start and end of the beam too. The look vector does not supply position.
local character_offset = HumanoidRootPart.Position
Beam.Inner.Position = HumanoidRootPart.CFrame.LookVector*11 + Vector3.new(0,3.25,0) + character_offset
-- ...
TweenService:Create(Beam.Inner,TweenInfo.new(.08),{
Size = Beam.Inner.Size + Vector3.new(45,0,0),
Position = Beam.Inner.Position + HumanoidRootPart.CFrame.LookVector*22 + character_offset
}):Play()
TweenService:Create(Beam.Outer,TweenInfo.new(.08),{
Size = Beam.Outer.Size + Vector3.new(45,0,0),
Position = Beam.Outer.Position + HumanoidRootPart.CFrame.LookVector*22 + character_offset
}):Play()