Raycasting is correct. Now checking if the material colours are being passed correctly. Also plugged a memory leak due to the material colours.