I am making a parkour system and currently working on a wall climb system. I am practically finished but I need the character to face the wall so I used body gyro and the surface normal of the raycast. The problem is that the player doesn’t face the wall. I don’t really understand surface normal.
function wallclimb() if trickval.Value == false then trickval.Value = true WCA:Play() local speed = math.sqrt(Root.Velocity.X^2 + Root.Velocity.Z^2) bpos.MaxForce = Vector3.new(math.huge,math.huge,math.huge) bpos.P = 6750 bpos.D = 700 bpos.Position = Root.Position + Vector3.new(0,5 + partsize.Y - (partsize.Y * 0.9) + (speed * 0.3) ,0) gyro.MaxTorque = Vector3.new(0,14000,0) gyro.P = 14000 **gyro.CFrame = CFrame.lookAt(gyro.Parent.Position, normal)** wait(0.6) WCA:Stop() bpos.MaxForce = Vector3.new(0,0,0) gyro.MaxTorque = Vector3.new(0,0,0) trickval.Value = false end end
Any help would be appreciated, Thanks