Trying to create a collision wall, where I can enter through one side,
but can’t go through another one
I’m Getting Error CS1519,
I can fix it by adding a " ; ", on the end of this line > GameObject.GetComponent
But it creates a new error, I’m really new to this, so explaining why the error is here, and how should I type the script, would be blessful.
using UnityEngine;
using System.Collections;
public class CollisionWall : MonoBehaviour {
GameObject.GetComponent<BoxCollider>
// Update is called once per frame
void update() {
// Makes the Wall a non colision object.
if (Input.GetKey (KeyCode.A)) {
BoxCollider2D.enabled = false;
Debug.Log("This is an Illusion");
}
else {
BoxCollider2D.enabled = true;
Debug.Log("This is a WALL");
}
}
}