Hey Everyone, I’m new to unity. I just downloaded unity 3.4.1 64-bit (because I’ve a low end pc) and for the first day got accustomed to the interface. The next day, I decided to start coding. I first decided to make a script for some basic input and movement. I created a sphere and then created a new script Test. After I entered the code, I decided to run it, but it said that I’ve entered the code incorrectly, but my code seems all correct to me. I tried many things, Destroy(GameObject); and commands like that works but input commands just does’nt. Pls help me. I’m using Unity 3.4.1 and MonoDevelop for coding.
The Code–>
using UnityEngine;
public class test : MonoBehaviour
{
public float speed;
void start()
{
speed=50f; rb=GetComponent<RigidBody>();
}
xInput=Input.GetAxis("Horizontal");
zInput=Input.GetAxis("Vertical");
void update()
{
//Trouble starts from here//
if(Input.GetKeyDown(KeyCode.W))
{
rb.Velocity=Vector3.Forward*speed
}
}
Pls pls help me