Can someone tell me what's wrong with this

local hi = CFrame.fromMatrix(self.Player.Instance.Character.HumanoidRootPart.CFrame.Position,self.Player.Instance.Character.HumanoidRootPart.CFrame.RightVector,,1,0).Unit)
			local hit,pos,surface,material = workspace:FindPartOnRayWithIgnoreList(,hi.LookVector.Unit * self.SwordDistance or 7),{self.Player.Instance.Character})

I don’t understand why it doesn’t works.
What I am trying to do, is ray cast at front, by using CFrame.FromMatrix()
Ignoring the rotation basically,
I am trying to get the look vector without rotation on Y axis
But with CFrame.fromMatrix() it was possible, i forgot how

Why don’t you just Raycast forward from the HumanoidRootPart, as it’s orientation never changes on that local axis, unless you are doing something weird?, Character.HumanoidRootPart.CFrame.LookVector * ExtendDistance)

I am editing the C0 of the joint to make it rotate for other stuff, I need to get like the shown in pic

Exactly. You should be editing the C0 of the Motor6d connection to the Torso, not the HumanoidRootPart. The HumanoidRootPart should always stay level.

1 Like