- Home /
Raycast problems unexpected token var etc.
var range : float = 1000;
var force : float = 1000;
function Update ()
{
if(Input.GetButtonDown("Fire1"))
}
function()
{
var hit : RaycastHit; } { var directionray = transform.TransformDirection (Vector3.forward); Debug.DrawRay(transform.position , directionray * range , Color.yellow); if(Physics.Raycast(transform.position , directionray , hit, range)); }
Answer by whydoidoit · Sep 18, 2012 at 08:47 PM
You need something in that if(Physics... line - currently it says "if" and then doesn't say what to do - so the compiler is complaining that it expected you to do something but instead you ended the line.
Answer by NhommeBeurreOne · Sep 19, 2012 at 01:22 AM
First, edit your post so it can readable.
Second, your code is full of bugs just edit the post and we'll be in mesure to help you out. 
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                