Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | SpugediWestern78 |
Hello,
I’m new and I’m working on a basic 2-D platformer, but I’m already stumped by basic gravity. Here is my code so far
[
extends KinematicBody2D
const ACCELERATION = 512
const MAX_SPEED = 64
const FRICTION = 0.25
const GRAVITY = 200
const JUMP_FORCE = 128
var motion = Vector2.ZERO
func _physcis_process(delta):
motion.y += GRAVITY * delta
move_and_slide(motion)
]
I know this isn’t much, but at this point, my character should fall on the tilemap I have below him, no? But it won’t even do that. It worked at one point, but once I added left and right motion it just stopped. I scrapped the script and started over, but now it won’t even fall again. I could start the entire project over again, but before I move forward I just want to make sure I’m not crazy and don’t repeat the same mistake.
Thank you in advance.