- Home /
This question was
closed Feb 13, 2020 at 08:25 PM by
ZachRoman121 for the following reason:
Other
Question by
ZachRoman121 · Mar 23, 2017 at 09:24 PM ·
raycastlayerslayerraycasts
How do i add a layer to a gameobject?
I am trying to make a gameobject be on the Ignore Raycast layer using code. How do i do this?
Comment
Best Answer
Answer by JC_SummitTech · Mar 23, 2017 at 09:35 PM
gameObject.layer = LayerMask.NameToLayer("IgnoreRaycast");
Follow this Question
Related Questions
Strange 'Glitch' while trying to apply the built-in layer "Ignore Raycast" via code 0 Answers
How to create User layer that acts like the "Ignore Raycast" layer? 1 Answer
How do i make my own ignore raycast user layer? 1 Answer
Raycast ignore layers except 1 Answer
Detecting that I'm clicking a unit even though I'm not? 0 Answers