Unity Interview Question

Resolving an issue with a function returning garbage.