should I use tween, lerp_angle or linear_interpolate?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Daniel Cavalli

Hi I’ve just implemented some steering code for a player sprite, and in the interests of learning I’ve implemented it in a few different ways for testing purposes… Basically for rotation I’ve tested linear_interpolate, lerp_angle, and also a tween node. The tween node offers a number of transition options so I think I’d go with that… but I’d like to know in the interests of “best practice”, do I need to be wary of using tweens arbitrarily - ie is there a performance hit? For example I intend to use this same steering code for NPCs also.

:bust_in_silhouette: Reply From: Daniel Cavalli

for rotation I’m going to use lerp_angleto interpolate as it finds the shortest angle between current direction and the target direction.

	global_rotation = lerp_angle(global_rotation, target_dir.angle(), steer_force.length() * _delta)