Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Lacee666 · Apr 13, 2012 at 05:09 PM · errorgame

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.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Apr 13, 2012 at 05:35 PM 0
Share

Hi. Not sure what the actual problem is. Is it importing the models, or the textures. Attaching scripts to gameObjects. Do the scripts give errors. $$anonymous$$aybe show us what script is not working, what you are trying to attach the script to, what language do you program in (js, C#). $$anonymous$$ore information on the exact problem and hopefully someone can help.

avatar image Lacee666 · Apr 13, 2012 at 06:09 PM 0
Share

http://www.youtube.com/watch?v=pgEwA_XnoH8

In this video, shows, how to create a collision. In 3:09 shows the script.

http://kepfeltoltes.hu/120413/$$anonymous$$_pkiv_g_s2_www.kepfeltoltes.hu_.png

First link. This is a Javascript. When I was typing, I received this message.

http://kepfeltoltes.hu/120413/464808125$$anonymous$$_pkiv_g_s_www.kepfeltoltes.hu_.png

The second link. Here is the full java script whats the video shows. And I put this in to the object, and nothing happens. The program doesn't paint the commands, you can see it, I don't know why. Is this a problem?

I'm a beginner of this unity, so I only know how to create the terrarian, and other things, but the program$$anonymous$$g ---> 0%

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by AlucardJay · Apr 13, 2012 at 06:49 PM

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 =]

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lacee666 · Apr 13, 2012 at 07:40 PM 1
Share

Thanks. It's work! You are a god. So.... The program$$anonymous$$g not enough, I must add any components to works?

Now I have a way to create a game. Now I know, what I have to do! Thanks!

avatar image AlucardJay · Apr 13, 2012 at 07:48 PM 0
Share

for physics , yes you need a RigidBody (also for some collisions and triggers you also need it). Happy I could help =]

$$anonymous$$ore information :

Collisions : http://unity3d.com/support/documentation/ScriptReference/Collider.OnCollisionEnter.html

Triggers : http://unity3d.com/support/documentation/ScriptReference/Collider.OnTriggerEnter.html

avatar image
0

Answer by badProphet · Apr 13, 2012 at 06:56 PM

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

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lacee666 · Apr 13, 2012 at 07:42 PM 0
Share

Thanks. Good tutorial.

avatar image
0

Answer by Lacee666 · Apr 13, 2012 at 06:56 PM

Hi.

http://www.youtube.com/watch?v=pgEwA_XnoH8

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Apr 13, 2012 at 07:17 PM 0
Share

did you see my answer? I stepped out how to add a rigidbody, I think this is why yours wouldn't work. I wrote it following the video you linked.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

WHY SAYS ME THAT IS AN ERROR? 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Scripting error #2! 2 Answers

Weird collision error when using waypoint script... 1 Answer

Getting index of the smallest number in a list 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges