Post by kyle on Oct 17, 2023 0:35:21 GMT
I am working on implementing Spherical Gravity. I have found this tutorial:
and was able to use the GravityAttractor and GravityBody Scripts. I added a sphere and made it 500 units in diameter. I then attached the gravity attractor script to the sphere. For the character, I added the GravityBody script to the player which is also using the invector third person controller. I did not use their script.
It works okay if I am on top of the sphere. The gravity attractor script does kick in and will keep the player oriented correctly. However, it seems like it is fighting as the slope gets too steep. The main problem seems to be the movement is not adjusted correctly.
When i start the character at the bottom of the sphere he seems like he is falling. I then adjust the distance to ground variable to be negative and his animation is now a standing animation. he is able to walk around but the more he walks, he seems to be walking in a straight path and slowly comes back to the surface of the sphere when I stop moving.
I saw there were two other similar threads with out a solution to this but suggestions to try using an off the shelf gravity solution, try using mario galaxy gravity, and one that said disable gravity and rewrite your own implementation.
I would like to take a minimalistic approach. It seems most gravity assets work the same by applying a force very similar to the script I am trying. It would then seem that I need to update the code. Based on my quick results from the basic tests I ran. I need to update some special cases or change the way the standard code calculates the movement and rotation of the character relative to the ground/force of gravity.
Any suggestions are greatly appreciate. Thank you in advance for your time and help.
and was able to use the GravityAttractor and GravityBody Scripts. I added a sphere and made it 500 units in diameter. I then attached the gravity attractor script to the sphere. For the character, I added the GravityBody script to the player which is also using the invector third person controller. I did not use their script.
It works okay if I am on top of the sphere. The gravity attractor script does kick in and will keep the player oriented correctly. However, it seems like it is fighting as the slope gets too steep. The main problem seems to be the movement is not adjusted correctly.
When i start the character at the bottom of the sphere he seems like he is falling. I then adjust the distance to ground variable to be negative and his animation is now a standing animation. he is able to walk around but the more he walks, he seems to be walking in a straight path and slowly comes back to the surface of the sphere when I stop moving.
I saw there were two other similar threads with out a solution to this but suggestions to try using an off the shelf gravity solution, try using mario galaxy gravity, and one that said disable gravity and rewrite your own implementation.
I would like to take a minimalistic approach. It seems most gravity assets work the same by applying a force very similar to the script I am trying. It would then seem that I need to update the code. Based on my quick results from the basic tests I ran. I need to update some special cases or change the way the standard code calculates the movement and rotation of the character relative to the ground/force of gravity.
Any suggestions are greatly appreciate. Thank you in advance for your time and help.