Skip to content

Instantly share code, notes, and snippets.

@winston-yallow
winston-yallow / MouseAxis.gd
Last active December 11, 2019 22:47
Mouse handling for godot emulating a controller axis
extends Node
var mouse_direction_sensitivity := 0.004
var mouse_direction_deadzone := 0.05
var mouse_direction_raw := Vector2()
var direction := Vector2()
func _input(event: InputEvent):
if event is InputEventMouseMotion:
@winston-yallow
winston-yallow / test.gd
Last active January 25, 2024 06:32
Godot 4.x Compute Example
extends Node
# Based on this tweet by Clay John:
# https://twitter.com/john_clayjohn/status/1306447928932753408
func _ready() -> void:
# Create a local rendering device.
var rd := RenderingServer.create_local_rendering_device()
@winston-yallow
winston-yallow / attention.md
Last active August 30, 2021 15:22
Godot - Curve Follow Shader

Attention

I created this for smooth curves with a small bake interval. The shader will interpolate the forward direction, so this is not suited for curves that are not smooth.