Skip to content

Instantly share code, notes, and snippets.

View WolfgangSenff's full-sized avatar

Kyle Szklenski WolfgangSenff

View GitHub Profile
@WolfgangSenff
WolfgangSenff / ForZon.gd
Created April 20, 2019 02:47
Move in 3D space in Godot using translation
extends Spatial
var speed = 100
func _physics_process(delta):
if Input.is_action_pressed("ui_space"):
translation += speed * (Vector3.RIGHT.rotated(Vector3(0, 1, 0), rotation.y)) * delta
func _input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
@WolfgangSenff
WolfgangSenff / GetDirections.gd
Created March 29, 2019 12:35
Get the direction you're moving in, in Godot
func get_direction(pos : Vector2) -> String:
var B := pos # next position
var A := global_position # current position
var direction := B - A
direction = direction.normalized()
var angle = direction.angle()
var cos_angle = rad2deg(cos(angle))
var sin_angle = rad2deg(sin(angle))
@WolfgangSenff
WolfgangSenff / SimpleMove.gd
Last active December 24, 2019 00:58
Touch-move in 3D for Godot 3.0
extends Spatial
signal tapped(card)
signal released(card)
var is_tapped = false setget set_is_tapped
var should_process_touch = true
func set_is_tapped(value):
is_tapped = value