So basically I have a bunch of trail renderers and the Vector3.MoveTowards a specific position with randomized TrailRender.Time and Speed for MoveTowards(). But they pause when reaching it and then go. Im not sure how to fix this, its probably very simple Im just new.
Its a not as easy to notice here but it is in game and it annoys me. These are the properties and script.
public class RobotSpiritTrail : MonoBehaviour
{
private TrailRenderer TRender;
[SerializeField]private Transform GoTo;
[SerializeField]private float speed;
private float newSpeed;
private bool Waiting;
private void OnEnable() {
Waiting=false;
newSpeed=speed+Random.Range(1,8)*.1f;
TRender.time=.1f+Random.Range(0,6)*.1f;
TRender.Clear();
}
void Awake()
{
TRender=GetComponent<TrailRenderer>();
}
void Update()
{
print(Time.time);
transform.position=Vector3.MoveTowards(transform.position,GoTo.position,newSpeed);
if(TRender.positionCount==0&&!Waiting)
{
gameObject.SetActive(false);
}
}
}