Hey everyone!
Im new at this, like many here asking, so sorry for taking your time
Im currently trying to learn and Im using Brackys tutorial
(url: somewhere around 14 is this code )
But I´ve been toubled with 2 errors that I cant get past.
Also, how do you do the {} thing? I can only copy paste and cant write it in the code :c
So Here is my Errors:
(
(16,39) Expecting ), found ‘colInfo’
(16,46) Unexpected token: )
And this is my Code:
#pragma strict
function Start () {
var randomNumber = Random.Range(0, 2);
if (randomNumber <= 0.5) {
rigidbody2D.AddForce (new Vector2 (80,10));
}
else {
rigidbody2D.AddForce (new Vector2 (-80,-10));
}
{
void; OnCollisionEnter2D (Collision2D colInfo); {
if (colInfo.collider.tag == "Player")
{
velY = rigidbody2D.velocity.y;
velX = rigidbody2D.velocity.x;
rigidbody2D.velocity = new Vector2(rigidbody2D.velocity.x , velY/2 + colInfo.collider.rigidbody2D.velocity.y/3);
}
}
}
}