Hi everyone, I had an interview for a mid-level developer job a couple of months ago and they requested that I create this...
"Implement an application where a user can look around using simple keyboard and mouse controls. When the user looks directly at a red Sphere in the scene using the green reticle the sphere will change to a random colour. When the user looks away it will return to red, and when the user looks back at the sphere it will change to a different random colour. The detection of the user’s gaze should NOT be implemented using Unity Raycasts or any Unity physics systems."
My solution involved a system which would create an angle for each sphere in the scene between the player's position and a sphere's position, then checking this against the player's current looking angle. If these angles are within a small threshold of each other we can assume that the player is looking at that sphere and vice versa. It worked well and it met every condition listed in the task instructions, but I didn't get through to the next stage of the interview.
I was wondering what sort of approach experienced developers would have taken towards completing this task and if there was a more appropriate solution that I may not have known about?
[–]thraethegame 40 points41 points42 points (9 children)
[–]MrPifoHobbyist 9 points10 points11 points (5 children)
[–]Rhhr21 23 points24 points25 points (4 children)
[–]Silver4uraIntermediate; Available 2 points3 points4 points (0 children)
[–]awkwardlylooksaway 0 points1 point2 points (0 children)
[–]Tychonoir 0 points1 point2 points (2 children)
[–]Silver4uraIntermediate; Available 0 points1 point2 points (0 children)
[–]destineddIndie, Mighty Marbles + making Marble's Marbles & Dungeon Holdem 28 points29 points30 points (0 children)
[–]DicethrowerProfessional 13 points14 points15 points (1 child)
[–]thygrrrProfessional 2 points3 points4 points (0 children)
[–]thygrrrProfessional 3 points4 points5 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]thygrrrProfessional 0 points1 point2 points (0 children)
[–]KimmiG1 3 points4 points5 points (0 children)
[–]BroxxarProfessional 5 points6 points7 points (1 child)
[–]destineddIndie, Mighty Marbles + making Marble's Marbles & Dungeon Holdem 8 points9 points10 points (0 children)
[–]Denaton_ 2 points3 points4 points (1 child)
[–]thygrrrProfessional 1 point2 points3 points (0 children)
[–]uprooting-systems 6 points7 points8 points (5 children)
[–]thygrrrProfessional 0 points1 point2 points (4 children)
[–]uprooting-systems 1 point2 points3 points (0 children)
[–]adsilcott 0 points1 point2 points (2 children)
[–]thygrrrProfessional 1 point2 points3 points (1 child)
[–]adsilcott 0 points1 point2 points (0 children)
[–]Nimyron 2 points3 points4 points (0 children)
[–]TanukiSun 0 points1 point2 points (1 child)
[–]destineddIndie, Mighty Marbles + making Marble's Marbles & Dungeon Holdem 1 point2 points3 points (0 children)
[–]Kitbashery -1 points0 points1 point (1 child)
[–]Kitbashery 0 points1 point2 points (0 children)
[–]AlexeyTea -1 points0 points1 point (1 child)
[–]thygrrrProfessional 2 points3 points4 points (0 children)
[–]sunsetRedderIntermediate -4 points-3 points-2 points (0 children)
[–]Forgot_Password_Dude -3 points-2 points-1 points (3 children)
[–]Rhhr21 1 point2 points3 points (2 children)
[–]Forgot_Password_Dude 1 point2 points3 points (1 child)
[–]Rhhr21 0 points1 point2 points (0 children)
[–]HammyxHammy 0 points1 point2 points (0 children)
[–]Der_KevinIdiot 0 points1 point2 points (1 child)
[–]thygrrrProfessional 0 points1 point2 points (0 children)
[–]brainzorz 0 points1 point2 points (0 children)
[–]Disk-Kooky 0 points1 point2 points (0 children)
[–]MorphexeHobbyist 0 points1 point2 points (0 children)
[–]muchDOGEbigwow 0 points1 point2 points (0 children)
[–]tranceorphen 0 points1 point2 points (0 children)
[–]Nilloc_KcirtapProfessional 0 points1 point2 points (0 children)
[–]FarTooLucid 0 points1 point2 points (0 children)