Currently have a wall climbing system. I’m wondering how I can make the player’s HRP face the raycastResult.Position without completely breaking my code. I’ve tried doing this:
What @Dev_Peashie said has one problem and it’s that it will make the character look upwards incase the raycast is not on the same Y position, so you use the Hrp’s Y position instead
Totally true, Im sorry for not even thinking about that. You are right.
But if all raycasts that surround player have its origin from the center of the HRP, I hardly think any of them could be in a different Y value, unless the rays are not in a 90° related with HRP. But yeah, possibly that happens in the case of OPs approach
I applied this code. It worked! Although it worked, I was wondering how I could make it so that the player is perpendicular to the wall. Currently, if the player jumps onto the wall at an angle, they will be at an angle on the wall. What logic can I use to calculate a position perpendicular to the wall?
My understanding is that the surface normal is a directional vector perpendicular to the surface that was hit. It has a magnitude and a direction, right? I tried to implement it into my code, but with no avail. Should I just be setting the player’s CFrame to its current CFrame times the Normal or is there something else?