i was not statisfied with the script, and it could be better, lighter, etc. So i rewrote a bit and made it adjustable for different situations, The script has more comments then code, so it should help you figuring out how it works. (it’s easy, i’m not an hard coder)
I can already tell you it works OK on scaled-up models, only problem is that since the player is moving perpendicular to face normals, when walking on big balls the camera moves abruptly when walking on edges/ changing angle. Also the player will climb hills at an angle relative to the horizon…
Great for space game though, where the player can walk in non-gravity environments inside a space ship, for example. I’m working on a small demo, where I will switch between this script and another control scheme for the player, depending on the context.
Both has nothing to do with this script, it has to do with your movent- and camera script. All this script does is create gravity for the player(box) and align it to the floor it’s walking on, and when walking/jumping off from something on/at an angle that it alligns the z axis back up.
I did not add any script to your .blend file. I just opened it, added a big UV sphere, put the green “player” object on it and tested it “as is”.
Oh ok, didn’t even now i had a camera attached to it, i created the setup just in a 3d matter like the view of the movie is. In this case i recommend to make your own setup to see if that works for you, due to i guess i made this in bge and if opened in upbge there can be some conflicts causing this.
It’s not a big deal, and your script does exactly what you designed it to do. This is more of a “geometry” problem when dealing with large surfaces.