Skip to content

Instantly share code, notes, and snippets.

@workhorsy
Created December 18, 2021 21:05
Show Gist options
  • Select an option

  • Save workhorsy/087b0057b42a7f87d8de4983ce124ac3 to your computer and use it in GitHub Desktop.

Select an option

Save workhorsy/087b0057b42a7f87d8de4983ce124ac3 to your computer and use it in GitHub Desktop.
# Spatial moves without physics
func _physics_process(delta : float) -> void:
var speed := 1.0
var velocity := self.transform.basis.z * speed
self.transform.origin += velocity * delta
# KinematicBody moves with physics
func _physics_process(delta : float) -> void:
var speed := 1.0
var velocity := self.transform.basis.z * speed
move_and_slide(velocity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment