Btw. you should add a second loop before your current loop that waits until the pointer "character" is valid:

while(!character) wait(1);
while(vec_dist...


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends