Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR GDSCRIPT

godot 3d slowly rotate towards object

# Slowly rotate towards object in 3D space
func turn_face(target, rotationSpeed, delta):
	var global_pos = global_transform.origin
	var wtransform = global_transform.looking_at(Vector3(target.x,global_pos.y,target.z),Vector3(0,1,0))
	var wrotation = Quat(global_transform.basis).slerp(Quat(wtransform.basis), rotationSpeed*delta)

	global_transform = Transform(Basis(wrotation), global_transform.origin)
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #godot #slowly #rotate #object
ADD COMMENT
Topic
Name
7+3 =