One of your comment says:
// Deactive invicibility after at least 5 seconds…
But it looks like your timer is set to 1s. Have you tried to comment this and see if the real problem is the SetMaterial ?
One of your comment says:
// Deactive invicibility after at least 5 seconds…
But it looks like your timer is set to 1s. Have you tried to comment this and see if the real problem is the SetMaterial ?