Hey there,
I created a gauge for my player that should appear next to my player when collecting certain items. It works well except one part : I can’t manage to make it follow the player without it being janky.
How can I do this ?
Here’s how I did it so far :
private void SetPosition() {
Vector3 screenPos = pl.mainCamera.WorldToScreenPoint(pl.transform.position);
rTransformUI.position = Vector3.SmoothDamp(rTransformUI.position, screenPos, ref velocity, smoothTime);
}
It kinda smoothes it, but the smooth is WAY too slow and changing smoothTime doesn’t seem to impact it at all.
Prior to that, I had this (which was very janky, no matter if I called that in LateUpdate, FixedUpdate or Update) :
rTransformUI.position = screenPos
Thanks for the help ! ![]()