How do I stop this tween part from going backwards?

I’ve beeing at this for hours now and I just can’t seem to find a fix to it and it doesn’t help that I don’t do much part tweening.


Link to the problem/video:

TDLR: The part is tweening backwards when I just want it to go forward.

I dont see any issue, pls be specific.

The part is tweening backwards when I just want it to go forward. not both ways

Use CFrames.

local Size =, 2.192, 4.115)
local Offset = Your_Players_Torso.CFrame *, 0, Size.Z / 2)

Depending on where the beam should go, flip the, 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:

Sadly the character does move. (Edit: Sorry I mean the Enemy stops to do it’s attack so it does stop kinda)

Does it stop when it starts to attack, but then moves when the beam is visible?

My only idea right now is to loop a function by Connecting to RunService.Stepped, and adjust the CFrame of the Beam.

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.


TS:Create(Beam,, {Size = Size, CFrame = Offset):Play()

Create accepts a dictionary of the object’s properties with the target values.

damnit wrong post to edit

Oh no it’s spinning now.

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.

-- OR
-- IN
local Offset = RB.Torso.CFrame *, 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., 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)

why do we need the math.random?

Yeah this isn’t working the beam keeps on flinging weirdly do you think there is a easier way of doing this?

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).

it’s almost the same as the last clip I sent yes

Try this:

local Offset = RB.Torso.CFrame * Beam.CFrame.Rotation * / 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…

Good news it looks a lot better now!
however it could use some changes


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.

We’ve fixed it!

Here it is working:

Thank you so much YVRN!

This is for me for later.

1 Like

It isn’t fixed :frowning: for some reason it’ll fire from the side.

where is this script meant to go?