Question by
Wolfrik_Creations · Jun 05, 2016 at 01:51 AM ·
c#javascriptraycastlayersphysics.raycast
Make a Raycast pass through a layer?
Okay so I know how to do this but instead of it working correctly, it just ignores that layer all together.
I need the Raycast to literally pass through it and hit the object on the other side.
if(Physics.Raycast(camTransform.position, camTransform.forward, hit, 15, ~(1 << LayerMask.NameToLayer("Locking Placement")))&&!Input.GetMouseButton(1)&&takeAffect) {
That chunk is what the problem is, please help because I can't place objects on my floors due to this.
I think C# and JS are the same with Raycast so I will just put both in the tags, though I use JS.
Comment
Your answer
Follow this Question
Related Questions
Raycast variable type in C#? 1 Answer
[fixed] My physics.raycast vision doesn't work as I expect it to, and I don't know why 2 Answers
How can I make my Raycast ignore my player, but have other player's Raycasts be able to hit it? 1 Answer
Need help with Ray casting syntax. 1 Answer
How actually work LayerMasks in Physics.Raycast ()? 0 Answers