- Home /
BCE005: Unknown Identifier :'KDefaultraycastLayers'
I'm getting the error BCE005: Unknown Identifier :'KDefaultraycastLayers' when trying to run my project.
I'm using version 3.3.0f4 (63235).
Code as below:
var blockHeight : float = 1.0; var blockMaterial : Material; var blockPhysicMaterial : PhysicMaterial;
private var mouseHit : Vector3; private var dragging : boolean = false;
function MousePoint() : Vector3{ var ray = GameObject.FindWithTag("MainCamera").camera.ScreenPointToRay(Input.mousePosition); var hit : RaycastHit; Physics.Raycast(ray, hit, 100, kDefaultRayCastLayers); return hit.point; }
function OnMouseDown(){ mouseHit = MousePoint(); mouseHit.z = 0; dragging = true; }
function OnMouseUp(){ dragging = false; }
function Update () { if(dragging){ GetComponent(LineRenderer).enabled = true; GetComponent(LineRenderer).SetPosition(0, mouseHit); GetComponent(LineRenderer).SetPosition(1, MousePoint()); } else { GetComponent(LineRenderer).enabled = false; } }
@script RequireComponent(LineRenderer)
Any ideas as to why?
Answer by Bunny83 · Mar 09, 2011 at 10:02 PM
I think you want kDefaultRaycastLayers
edit
Oh, after fixing your code highlighting i've saw you use the right name (with lowercase "k").
I'll check that...
... Well I've found it ;)
It's a class variable of Physics. So use:
Physics.kDefaultRayCastLayers
Your answer
Follow this Question
Related Questions
Unknown Identifier? 1 Answer
BCE0005: Unknown identifier 1 Answer
Why Unknown identifier? 1 Answer
'Unknown Identifier' - cannot recognize other scripts 1 Answer
Unknown Identifier? 1 Answer