I'm using a tween to try to get an object to follow the direct movements of the player. However an issue I've been having for a while is that the object will jitter whilst moving. Example:
(usually it's a lot worse than this, I don't know why it's so mild here)
Here's the code:
extends KinematicBody2D
onready var move_tween = get_node("/root/Node2D/partymember/Tween")
onready var player = get_node("/root/Node2D/KinematicBody2D")
var velocity = Vector2()
func party_move(target):
move_tween.interpolate_property(self, "position", velocity, target, 0)
func _process(_delta):
move_tween.interpolate_callback(self, 0.45, "party_move", player.position)
func _ready():
position = player.position
move_tween.start()
party_move(position)
I have tried things like pixel snap and changing the physics frame rate to see if it makes a difference but there wasn't any change.