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 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, which then should then teleport it to the next level! <--- i need help with the collision!

Here is what ive got so far:

function OnControllerColliderHit (hit : ControllerColliderHit)

{

if(hit.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 (hit : ControllerColliderHit)
{
  if(hit.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

Thanks! Very Helpfull! I figured out that you need to change the 'if' statment to: if(hit.gameObject.tag == "crate3lvl"), but thanks for your version! $$anonymous$$y if statment is a bit glitchy so im using yours! Thanks Again! #

avatar image JJAPrograms · Feb 21, 2011 at 02:33 PM 0
Share

Quick Question, Do you put this script inside the First Person Controller or inside the crate3lvl?

avatar image JJAPrograms · Feb 21, 2011 at 03:30 PM 0
Share

ive found out that you need to give the crate a Rigidbody (kinematic ticked) and a amesh collider. :D

avatar image
0

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

the crate doesnt need a rigidbody and a mesh collider for this particular bit of code. You need a box collider (because its a crate why use a mesh collider which 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 things 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 searching, 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 nothing 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 something you have interest in and please I am not trying to deter you from being creative but you need to learn to create these things properly especially if you plan to ask money for it. Right now it looks like everything you have done is a joke, not a funny one either. I'm sure you can do better but you need to do three things

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

Yet another question asked by my apprentice.

avatar image JJAPrograms · Mar 11, 2011 at 04:30 PM 0
Share

Anyway, as you can see, there is no point in answering this question, it has already been answered, if you can't read.

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

No one has followed this question yet.

Related Questions

load level on collision 2 Answers

Attaching a Hinge Joint upon colliding with a rigidbody. 1 Answer

Destroy on collision 3 Answers

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

jump on collision enter 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