• 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 JJAPrograms · Feb 20, 2011 at 06:00 PM · collisionlevelenteronnext

On Collision enter the next level? Help please?

Right, when my 1st person character has defeated all of the aliens, <-- done fine its task is to get to a box, w$$anonymous$$ch then should then teleport it to the next level! <--- i need help with the collision!

Here is what ive got so far:

function OnControllerColliderHit ($$anonymous$$t : ControllerColliderHit)

{

if($$anonymous$$t.gameObject == "crate3lvl") {

Application.loadlevel("Level 2.unity")

}

SO i kind of need some help! Please!

Comment
Add comment
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

2 Replies

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

Answer by codesennin · Feb 20, 2011 at 06:49 PM

function OnControllerColliderHit ($$anonymous$$t : ControllerColliderHit)
{
  if($$anonymous$$t.gameObject.name == "crate3lvl")
    Application.loadlevel(1); // or "Level2" if you name it that way, use 1 if it's the second on the list.
}

Don't forget that you must add your level though to the list of levels

Comment
Add comment · Show 3 · 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 JJAPrograms · Feb 21, 2011 at 02:32 PM 0
Share
avatar image JJAPrograms · Feb 21, 2011 at 02:33 PM 0
Share
avatar image JJAPrograms · Feb 21, 2011 at 03:30 PM 0
Share
avatar image
0

Answer by AngryOldMan · Mar 10, 2011 at 09:54 PM

the crate doesnt need a rigidbody and a mesh collider for t$$anonymous$$s particular bit of code. You need a box collider (because its a crate why use a mesh collider w$$anonymous$$ch takes more processing power) with "is trigger" checked.

please please PLEASE complete some basic tutorials and learn from them, also keep http://unity3d.com/support/documentation/Manual/index.html the unity manual handy so that you can find out simple t$$anonymous$$ngs about the unity engine instead of asking stupid questions (I'm sure they are not stupid to you but seen as though you can find the answer with a bit of searc$$anonymous$$ng, yes they are a stupid) also when your having coding problems http://unity3d.com/support/documentation/ScriptReference/index.html keep the script reference around, it has every syntax and and how to use them.

also your "game" is spelt wrong, "private front tire" would be a good name for some form of driving army game but as a MASSIVE rip off of the official Unity FPS tutorial. And asking people to pay to download your (shockingly appauling) game is an insult, anyone who pays to download it is dumber than you are and all your doing is taking advantage of idiots. You know not$$anonymous$$ng about creating a game, I understand that everyone has to start somewhere, but you need to start from the begininng instead of sticking some crap on the internet and asking people to pay for it.

Also your website is horrible to navigate, http://www.webpagesthatsuck.com/ maybe you can see why after some RESEARCH. It's fools like you reproducing and producing kids that are fools like you, that's the reason why the human race is in decline. I appreciate you are making an effort to do somet$$anonymous$$ng you have interest in and please I am not trying to deter you from being creative but you need to learn to create these t$$anonymous$$ngs properly especially if you plan to ask money for it. Right now it looks like everyt$$anonymous$$ng you have done is a joke, not a funny one either. I'm sure you can do better but you need to do three t$$anonymous$$ngs

1) LEARN

2) RESEARCH

3) IMPROVE

never give up on your dreams but dont pretend that your puddle of hogwash deserves to be credited. Especially since you want people to pay you for it!

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 JJAPrograms · Mar 11, 2011 at 04:27 PM 0
Share
avatar image JJAPrograms · Mar 11, 2011 at 04:30 PM 0
Share

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

load level on collision 2 Answers

OnTriggerEnter problem 3 Answers

open door to next level, after 10000 points were added to your score (solved) 2 Answers

Network.Destroy in OnCollisionEnter; not working. 1 Answer

OnTriggerExit() help 0 Answers


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