@TwistedTwigleg
Animation:
I fixed the issue with the continuous character walking animation by ramping up the Deacceleration, because I think that it continued pure because the character never reached a total stand still but was still sliding along.
For the slope:
I am trying to get my character to climb and slide down slopes but using the following tutorial:
There is a way to get the character to auto detect if the slope is climable or not but it fails.
This can be done as follows:
get_parent().move_and_slide(velocity, Vector3(0,-1,0), true, 45)
this fails because the character will still slide down when pressing a different key or it sometimes doesn't detect the slope correctly
I've looked through the code and did see that is_grounded
is the same as is_on_floor()
and that I need to say get_parent().is_grounded
because this line of code isn't in the AnimationSprite3D node but used for the KinematicBody(3D).
There is a certain line that I can set that is floor_max_angle()
. This value is automatically set to 45 degrees and tells the code until what point something is a floor or not so I might be able to set this to 32 degrees.
I am telling this because I now (when using your code) have weird issues with my Main Hub land (you might have seen some of my Twitter videos or pictures and you might have seen that it isn't flat at all). My character keeps "falling" or "sliding" downward even if it is less than a degree different.
And now for the weird instant acceleration fall:
I applied a simple "Detect if the player is in the air code"
var in_air = 0
if is_grounded == false:
print (in_air)
in_air += 1
the simple detector works and tells me that the character is still on the ground and not floating somewhere meaning that the character isn't accelerating whilst "being on a flat surface"
I first thought that it had something to do with the ADDITIONAL_GRAVITY
but after puzzling around for a bit I wasn't able to get a result of ever slowing it down. Same happend to normal Gravity
and the applied_gravity +=
(I tried changing up the equation to fit the bill as well with no good results)
So I tried looking for answers to why this acceleration could be happening and there I found a person complaining about this problem as well.
https://godotengine.org/qa/57857/is_on_floor-works-unreliably-doing-something-wrong-godot
As response on the that question there were links sent. All of them were for a 2D platformer but the person that answered assured that a KinematicBody2D is almost the same as a KinematicBody (3D) so I tried to use these websites as well.
https://docs.godotengine.org/en/latest/tutorials/physics/using_kinematic_body_2d.html#platformer-movement - Simple tutorial and understanding of what a KinematicBody2D can do and what the difference is between move_and_slide()
and move_and_collide()
http://kidscancode.org/godot_recipes/2d/platform_character/ - also a tutorial but with something that might help with my problem at the moment.
"Note that we’re checking is_on_floor() after using move_and_slide(). The move_and_slide() function sets the value of this method, so it’s important not to check it before, or you’ll be getting the value from the previous frame." I tried this one as well but with no succes really.
https://github.com/godotengine/godot-demo-projects/tree/master/2d/platformer (DEMO-PROJECT)
The last bug is when going up a simple hill. I made a testzone where I can test if my character gets stuck on certain angles of slopes but for some weird reason I am getting stuck at the foot of the slope. This might be a Gravity issue. because I tinkered with the speed and the acceleration with no result and the fall detector also doesn't detect the character falling.
Sorry if this is a lot of reading but I am just really happy to figure this one out.
thanks,