Scripting problem

I downloaded Unity 3d free version. I wanted to create a game. I modelled the objects in maya. I started the scripting, but my every scripts doesn’t works. While I scripting, the program doesn’t painted the correct commands, only the commands 20% painted. I saw many videos, but no one works. I tryed this in 3.4.2 and 3.5 . Is the problem that I have a free version?

My nature language is not english. Sorry for the mistakes.

I couldn’t see your pictures , but I think I can help.

Make a new script, then in the script write :

function OnCollisionEnter(theCollision : Collision)
	Debug.Log("Hit the " +;

Make a Floor , name it “Floor”.

Make a Cube.

Click on the cube.

Look in the Inspector window (very important) →

There are these “Components” :

  • Transform
  • Cube (mesh filter)
  • Box collider
  • Mesh renderer

you should also give the cube a “Rigidbody” . If no Rigidbody is in the Inspector , add one like this :

Look at at the top of the Unity window ,

( File - Edit - Assets - GameObject - Component - Terrain - Window - Help )

click on Component , then click on Physics > Rigidbody .
Now you should see Rigidbody Component in Cube Inspector (mass, drag, gravity, …)

don’t forget to drag-and-drop the script onto the cube also.

now Click on the cube , look in the inspector window , you should have :

  • Transform
  • Cube (mesh filter)
  • Box collider
  • Mesh renderer
  • Rigidbody
  • your script (Script)

now click play. Now the cube should fall down (gravity in rigidbody), and the message should appear “Hit the Floor” .

You need a rigidbody component for physics and collisions to work. Here is some information on Rigidbody :

Hope this helps =]

I think you can get more help if you post some of your code but I’d recommend checking out Lerpz here if you’re just getting started.

The Lerpz tutorial can be found here:


In this video, I’m trying to create a collision to the object. In 3:09, the video shows the java script.

In the first link, when I was typing, I reveived this message.

The second link. Here is my script. You can see, the program recognize my commands, but if the program recognized, the program will paint the correct commands. And every commands, I saw, didn’t work. Only a few.