How to offset off of torso, but ignore the vertical values (y) or keep it straight forwards?

  1. What do you want to achieve?
    I want to make a dash effect that offsets infront of the torso by 25 studs, and my effect is 50 studs long. I want to ignore the vertical values so that it can be straight ahead and not downwards.

  2. What is the issue?
    The effect is facing the correct way, but it is supposed to be straight forward and not downwards. I think this is because of moon animator affecting the torso cframe causing the offset to be straight from the torso, which is downwards.

Here is my code:

					local modelclone = originalmodel:Clone()
					modelclone.Parent = workspace

Here is what happens:

  1. What solutions have you tried so far?
    I couldn’t find much solutions or similar posts, and it’s probably because I use moon animation that affects the torso angle and causes the attack to go downwards. I also tried using LookVector and ignoring the y value but it still doesn’t work.

I know but I want it as torso on purpose because for the attack, I anchor the humanoid root part for a second then it activates. When you shift lock the humanoid root part doesn’t rotate but the torso does, and that’s why i’m using torso.

I just wanna know how to make the y value for the cframe to be flat and straight.

Try this

local X,Y,Z = Torso.CFrame:ToOrientation()
modelclone:SetPrimaryPartCFrame( * CFrame.Angles(0, Y, 0))

1 Like

Thanks it worked! But for some reason, shift lock is kinda weird and doesnt work but if you stay still it does work and I guess its fine for now. But I just want to know why it doesn’t go to shift lock place.

I think it’s the idle animation, try using the Head or the HumanoidRootPart, or adjust to create the radius moments before the idle animation


Or should I use humanoidrootpart? would that work? and when I use shift lock, it usually delays and doesnt go forward based on the shift lock direction.

I fixed it with using camera CF