Dear community,
I bet this is a very simple one, but I can’t seem to be able to see it.
I’ve got the following code:
function SelectionStartup () {
var hit : RaycastHit;
// This is the main function for selection purposes.
if(Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Began){
// Checking whether we have one touch, and if the phase is equal to "beginning", aka: It's just a touch. No moving.
if(Physics.Raycast(Camera.main.ScreenPointToRay(Input.GetTouch(0).position)), hit, 100){
// Checking whether we have hit anything with the touch.
// There are only the following type of objects we can hit: The Background, Tiles or characters.
SelectionWhatDidWeHit(hit.transform);
// Sending it through to the next function.
}
}
}
Now, the problem is: for some reason the line with the if(Physics.Raycast…) is giving me the following errors:
(100 is the line of if(Physics.Raycast))
Assets/Scripts/GridTaker/GridTakerData.js(100,93): BCE0044: expecting ), found ‘,’.
Assets/Scripts/GridTaker/GridTakerData.js(100,95): BCE0043: Unexpected token: hit.
Assets/Scripts/GridTaker/GridTakerData.js(100,100): BCE0043: Unexpected token: 100.
I can’t understand why. I’ve used this piece of code in another project too, and there it works.
With lots of love,
Jip