Turned off collision on the blocks by adding a script to them

using UnityEngine;
using UnityEngine.SceneManagement;

public class collisions : MonoBehaviour {
    BoxCollider boxCollider;

    // Use this for initialization
    void Start () {
        boxCollider = GetComponent<BoxCollider>();
    }
	
	// Update is called once per frame
	void Update () {
        if (Input.GetKeyDown(KeyCode.C))
        {
            boxCollider.enabled = false;
            print("c pressed");
        }
    }
}
1 Like

[question] I created the script above and attached it to the obstacles. The auto populate feature did not function in the new script but it did function in the rocket script. I had the same using items in both scripts. Does anyone know why the auto populate did not work in script above as I was typing it?

it happens sometimes…have you tried closing visual studio and opening it again?

I did close visual studio and unity and reopened with the same problem.

Privacy & Terms