These script errors are usually straight forward when it comes to misspelling or when something was expected or unexpected. However some of these are just that but i try fixing them and they dont make since to me. Here is my script for a minecraft game i am making. Also a list of my errors.
ERRORS
Assets/Scripts/BlockMaker.js(23,36): BCE0044: expecting ), found ‘.’.
Assets/Scripts/BlockMaker.js(23,56): BCE0044: expecting ), found ‘,’.
Assets/Scripts/BlockMaker.js(23,57): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/Scripts/BlockMaker.js(23,57): BCE0043: Unexpected token: LookingDirection.
Assets/Scripts/BlockMaker.js(23,75): BCE0043: Unexpected token: Hit.
Assets/Scripts/BlockMaker.js(23,80): BCE0043: Unexpected token: Range.
Assets/Scripts/BlockMaker.js(26,17): BCE0043: Unexpected token: }.
Assets/Scripts/BlockMaker.js(37,1): BCE0044: expecting }, found ‘’.
SCRIPT
var GrassBlock : Transform;
var StoneBlock : Transform;
var BlockSelected : float = 1;
var Range : float = 20;
function Update ()
{
if (Input.GetKeyDown(KeyCode.Q))
{
BlockSelected -= 1;
}
if (Input.GetKeyDown(KeyCode.e))
{
BlockSelected += 1;
}
if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1))
{
var Hit : RaycastHit;
var LookingDirection = transform.TransformDirection(Vector3.forward);
if (Physics.Raycast.(transform.position,LookingDirection, Hit, Range));
{
if (Input.GetMouseButtonDown(1))
}
if (BlockSelected == 1)
{
var GrassBlock : Transform = Instantiate(GrassBlock, Hit.collider.trasform.position + Hit.normal.normalized, Quarternion.identity);
GrassBlock.tag = "GrassBlock";
}
}
}