at the time I think there is a bug with Godot. I thought I had it all figured out but apparently not. I am following a tutorial by GDQuest on YouTube. it a basic 2d platform game. I create a player, I insert a graphics block I set the collision and create two scripts one is the player script and the other is the actor script I set up this script code:
extends KinematicBody2D
class_name Actor
func _physics_process(delta: float) -> void:
var velocity: = Vector2(300,0)
move_and_slide(velocity)
and it works fine. it moves the block right
but when I modify the code to this:
extends KinematicBody2D
class_name Actor
var gravity := 3000.0
var velocity := Vector2.ZERO
func _physics_process(delta: float) -> void:
velocity.y = gravity * delta
move_and_slide(velocity)
the block is suppose to move down but it just stand still as if the scene froze
and worst is that no matter what I do, if I replace it back to the previous code and run it the code does exactly as with this las code. the demo scene just seems to freeze. The block just won't move at all.
this thing has me stomp
Did I mention I am on a 2015 MacBook Air?