Skip to content

Instantly share code, notes, and snippets.

@GK-GreyGhost
Last active December 14, 2020 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GK-GreyGhost/dc98a3ffb2315090b1c76a2245f4b893 to your computer and use it in GitHub Desktop.
Save GK-GreyGhost/dc98a3ffb2315090b1c76a2245f4b893 to your computer and use it in GitHub Desktop.
extends Spatial
tool
var time:float = 0.0
export var time_scale:float = 1.0
export var distance_from_object:float = 6.0
export var look_at_position:Vector3 = Vector3(0,0,0)
func _process(delta):
time += delta * time_scale
translation.x = sin(time) * distance_from_object
translation.z = cos(time) * distance_from_object
look_at(look_at_position,Vector3.UP)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment