Hello!
I’m working on a wall jump mechanic along with a bunch of other stuff and I was just wondering how I would go about making it so I can make the HumanoidRootPart rotate depending on the normal that was hit when the player touched the wall jumper? Right now, regardless of the position I’ve hit the wall jumper from, it always makes me angled at 0,0,0
Ideally, it would face me away from the direction that I’ve touched the normal from.
So for example, I hit this face, I should be facing the way the red line is facing:
Any ideas of how I’d do this?
Here’s what I have so far:
v.Touched:Connect(function(otherPart)
if isInWall then
return
end
if otherPart:GetAttribute('WallJumper') then
raycastParams.FilterDescendantsInstances = {otherPart}
local ray = workspace:Raycast(humanoidRootPart.Position, humanoidRootPart.CFrame.LookVector * 100, raycastParams) -- casts a ray using the HumanoidRootPart's LookVector to ensure they're facing the wall jumper, I don't want them to get stuck if they aren't looking at it, and I don't want them to get stuck if they're on the top or on the bottom
if ray and ray.Instance == otherPart then -- then they should stick to the wall
local instance = ray.Instance :: BasePart
local normal = ray.Normal
humanoidRootPart.CFrame = CFrame.new(ray.Position) -- positions them as it should be, not sure how to get the angle tho
isInWall = true
humanoidRootPart.Anchored = true
torso.Anchored = true
end
end
end)