Quantcast
Channel: Answers for "How would I create a raycast that ignores Character Controller"
Browsing latest articles
Browse All 6 View Live

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 Article



Answer by Pharaoh_

Pretty much what @Cherno said, but you can use the inbuilt "Ignore Raycast" layer on the character controller.

View Article

Answer 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
Browsing latest articles
Browse All 6 View Live




Latest Images