Warnings for Tags/Layers

This commit is contained in:
Antoine H 2020-12-07 17:22:30 +01:00
parent c710d3c38e
commit 00211b3170
3 changed files with 18 additions and 11 deletions

View file

@ -44,8 +44,10 @@ public class Mug : MonoBehaviour, IGrabable
// Start is called before the first frame update
void Start()
{
//Needs to be on Interactions layer and have the Mug tag to work properly
gameObject.tag = "Mug"; //Force gameobject tag
if(gameObject.layer != LayerMask.NameToLayer("Interactions"))
Debug.LogWarning(gameObject.name+" layer should be set to 'Interactions' to work properly");
if(gameObject.tag != "Mug")
Debug.LogWarning(gameObject.name+" tag should be set to 'Mug' to work properly");
}
// Update is called once per frame