Question by
Sathori · Mar 17, 2017 at 08:42 PM ·
c#scripting problemgameobject
Help! Script won't work.
Hey guys. This is probably a dumb question but I can't figure out what did I do wrong. Here's the script:
using UnityEngine;
using System.Collections;
using System;
public class Test : MonoBehaviour {
// Use this for initialization
void Start () {
print ("Start");
Debug.Log("Start");
}
// Update is called once per frame
void Update () {
if(Input.GetKey(KeyCode.E)){
print ("Update");
Debug.Log("Update");
}
}
}
When I put this script on any gameObject of the scene, nothing happen. I don't know why and what is wrong in it. Can you help me? Thanks guys!
UPDATE: Ok, nevermind, I was just dumb and wasn't looking in the right console... Thanks for your help guys
Comment
I don't see anything wrong with the script. Are you sure the GameObject is actually in the scene, and it's enabled?
Yeah, The GameObject is just a basic cube in the scene and the script is on it.