Metal shader directory error when opening UE4Editor

I think this issue has been resolved; it seems to be an issue with cache folders that are created within /private/tmp on the Mac, and the permissions that they’re given. Have a look in /private/tmp/ for any folders that start with UE4_metal and delete them. Then try opening the app again.

The following function should get rid of these automatically, and could potentially be run on login to make sure these folders are removed.

for TMP_FOLDER in $(/usr/bin/find /private/tmp -name UE4_metal* -type d -maxdepth 1)
do
    writelog "Removing temp folder ${TMP_FOLDER}"
    /bin/rm -rf "${TMP_FOLDER}"
done

I see this as a bug with the software, as if multiple users are accessing a Mac without the mac restarting inbetween sessions, this issue will occur.