Scripting problem

Hi.
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 " + theCollision.gameObject.name);
}

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 :

http://unity3d.com/support/documentation/Components/class-Rigidbody.html

http://unity3d.com/support/documentation/ScriptReference/Rigidbody.html

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: http://unity3d.com/support/resources/tutorials/3d-platform-game.html

Hi.

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

http://kepfeltoltes.hu/120413/K_pkiv_g_s2_www.kepfeltoltes.hu_.png

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

http://kepfeltoltes.hu/120413/464808125K_pkiv_g_s_www.kepfeltoltes.hu_.png

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.