local Size = Vector3.new(154.45, 2.192, 4.115)
local Offset = Your_Players_Torso.CFrame * CFrame.new(0, 0, Size.Z / 2)
Depending on where the beam should go, flip the CFrame.new(0, 0, **Size.Z / 2** to negative. Then add CFrame on the first Tween. This will work best if the character does not move.
Also, use three ` on both ends of your code to paste your code on a separate paragraph, or one of it on both ends to paste smaller snippets of code inline. To demonstrate without the post getting formatted:
The enemy will start his attack and once the animation and the beam stop then he’ll start moving again.
I’ve also added your code I and don’t think it’s working although I might be doing it wrong.
The CFrame’s Y value is incorrect. In the Offset variable, try adding math.rad(90) in the Y value, and test with negative or positive values.
math.rad(90)
-- OR
math.rad(-90)
-- IN
local Offset = RB.Torso.CFrame * CFrame.new(0, Put the Y value here, Size.Z / 2
Oh yeah, I also forgot that the actual length is Size.X because it is 154.45 studs long. Use that instead, and flip the X axis with - to check for its direction.
CFrame.new(0, 0, Size.X / 2) -- Change the Zto the X if it is going in the wrong direction (e.g. (Size.X / 2, 0, 0) or (-Size.X / 2, 0, 0)
math.rad converts degrees to radians. It is not math.random.
By that do you mean the beam spins extremely fast, or is it the same as the last clip you sent? If it’s the former, have you used math.rad? If it’s the latter, send the current code you have? (Please use the backticks for pasting code ("`"), don’t screenshot).
local Offset = RB.Torso.CFrame * Beam.CFrame.Rotation * CFrame.new(Size.X / 2, 0, 0) -- This should move the beam forward. If it goes backwards, set Size.X / 2 to negative.
I don’t exactly know the default rotation of the beam, so…
The Beam isn’t exactly angled with the torso when it fires. Prior to getting the beam to animate, set its CFrame just like Offset, but without the Size offset.
Beam.CFrame = RB.Torso.CFrame * Beam.CFrame.Rotation -- This sets the CFrame of the Beam at the torso, before it gets tweened.