Whenever my player character lands on the floor, they cannot move. (isonfloor always comes back false for some reason) Heres my player's script:
extends KinematicBody
Initializes Variables
var velocity = Vector3(0,0,0)
const speed = 1
var acc = 1
var gravity = 0.01
Handels Player Physics
func physicsprocess(delta):
velocity.y -= gravity
if Input.iskeypressed(KEYD) and Input.iskeypressed(KEYA):
velocity.x = lerp(velocity.x, 0, 0.1)
elif Input.iskeypressed(KEYD):
velocity.x = min(velocity.x + acc, speed)
elif Input.iskeypressed(KEYA):
velocity.x = max(velocity.x + -acc, -speed)
else:
velocity.x = lerp(velocity.x, 0, 0.1)
moveandslide(velocity, Vector3.UP)
Any Ideas?