It would be 165 degrees at the bottom of the hill, and I believe 195 degrees at the top(?) This is some weird mathin 3D space, but 2 vectors pointing towards each other is 180 degrees in 2D space.
I found math for the “angle between 2 vectors” on this forum somewhere. I was using it find whether 2 models could see each other, but I’m certain its the same formula here. Check this thread out that talks about it in detail. If this isn’t working for you, I can dig through my game tomorrow and see what worked for me.
The angle should tell you when the board is not flush with the ground, which is what I thought you were trying to fix in the second video. It’s looking a lot better!
Lol, your force equation is above my head, but the solution I linked would potentially replace your ray (since that’s what this one does as well), and fix the tilt.
I would scrap using the humanoids orientation alltogether, because no matter how much you doctor it up its still the wrong angle at the end of the day
Ill be going with an angle approach like @GolgiToad described
Instead of humanoid.Orientation.X, try:
local dotX = skateboardlookvector:Dot(normalVector)
local orientX = (math.deg(math.acos(dotX))-90)*math.sign(dotX)
Instead of humanoid.Orientation.Z, try:
local dotZ = skateboardrightvector:Dot(normalVector)
local orientZ = (math.deg(math.acos(dotZ))-90)*math.sign(dotZ)
I highly doubt this will work first try but hopefully it will set you on the right track
Some basic troubleshooting would be making sure the look vector of the skateboard is actually forwards and that the right vector of the skateboard is actually facing right
Also you might want to mess with the first argument of your PID, I have no clue what it does but it might have undesired effects
Yes, simply take your original code and replace the humanoid angles with those calculated angles
You might have to mess with the first argument of the pid