Hi Guys im sorry to bother you with my question, but I haven´t found a solution yet.
I´m currently working on a Mobspawn Skript with Java
#pragma strict
var Spawn = false;
function Update ()
{
function OnTriggerEnter (theCollider : Collider)
{
if (theCollider.tag == "Player")
{
Spawn = true;
}
}
function OnTriggerExit (theCollider : Collider)
{
if (theCollider.tag == "Player")
{
Spawn = false;
}
}
}
So my idea was to create an empty object wich Spawns Enemys as long as the Players collision box collides with the empty´s collison box until a certain number of mobs is reached.
I´ve checked it a hundred times by now and compared it to similiar scripts which work. But still im getting the following Errors:
Assets/Enemyspawn.js(10,10): BCE0044: expecting (, found ‘OnTriggerEnter’.
Assets/Enemyspawn.js(10,26): BCE0043: unexpected token: theCollider.
Assets/Enemyspawn.js(10,49): UCE0001: ‘;’ expected. insert a semicolon at the end.
Assets/Enemyspawn.js(12,17): BCE0043: unexpected token: if.
Assets/Enemyspawn.js(12,49): UCE0001: ‘;’ expected. insert a semicolon at the end.
Assets/Enemyspawn.js(10,10): BCE0044: expecting :, found ‘=’.