Answer by Cherno
It's true that a component can't have a layer, only a gameObject can. However, this is irrelevant since all components on a gameObject are bound to the gameObject's layer. So just make the RayCast use...
View ArticleAnswer by Pharaoh_
Pretty much what @Cherno said, but you can use the inbuilt "Ignore Raycast" layer on the character controller.
View ArticleAnswer by Mouton
Don't set the layer to the component but to the gameobject. GetComponent().gameobject.layer = LayerMask.NameToLayer("nameOfYourGameObjectLayer") LayerMask rayMask = 1
View Article
More Pages to Explore .....