Alligning character to the wall side ways using CFrame?
So I'm making a parkour game and before this issue, I've made the character successfully face the wall when it wants to scale the wall.
Anyway, that was for climbing, right now I'm making the second part allowing the player to wall-run which also works fine, the only thing I want to add is to make the character face the wall it's running, but sideways. this works for walls that are rotated -45 degrees, but not on walls in other directions. I'm trying to make this dynamic and I've tried several things.
CFrame_Line:
3 | ,Vector 3. new(hrp.Orientation.X |
4 | , wallpart.Orientation.Y - rightcastresult.Normal.Y |
I've tried adding 90 degrees to the CFrame like
1 | Cframe_Line*CFrame.Angles( 0 ,math.deg( 90 ), 0 ) |
3 | Cframe_Line*CFrame.Angles( 0 ,math.rad( 90 ), 0 ) |
I've tried using RightVector
1 | CFrame.New(Cframe_Line.Position, Cframe_Line.RightVector) |
but none proved any different.
right now I have footage of it working on 1 type of wall in a particular direction, and also not working on other wall directions:
youtube wallrun issue
Here's how the raycast works and how I want it to work the raycast is set up fine.
raycast lines