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 sjax.1983 · Nov 12, 2012 at 02:47 AM · collisionscene

Scene Load Issues

So I realize this is a common question and have covered numerous posts trying to solve this myself. I have built several scenes and am attempting to get them linked together based off collisions with set objects. Regardless of how I try to change things around I cant get the object collision to load another scene.Below is my code.

var myLevel : String;

function OnCollisionEnter (myCollision : Collision) { if(myCollision.gameObject.name == "Warp"){ Application.LoadLevel(1); } }

  1. I have made sure that the object is a ridgidbody non-kinematic

  2. I have made sure that both my character and the object have colliders set with "is trigger"

  3. Made sure that they are on the same layer.

  4. Made sure that the scenes are included under Build Settings

Any help would be appreciated.

Comment
Add comment · Show 1
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 spiceboy9994 · Nov 14, 2012 at 09:27 PM 0
Share

Is this behavior attached to your character?, since you're asking for an external collider with the name of "Warp". Be sure this behavior is attached to your character and not to your "Warp" object. Also (and just to be logical) be sure the collision game object name is actually "Warp".

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Wiki

Answer by silverdreamx · Nov 12, 2012 at 08:07 AM

I am not sure if this helps, but instead of doing string checks like

 myCollision.gameObject.name == "Warp"

you should probably do it this way

 myCollision.gameObject.name.CompareTo("Warp") == 0

Check out the documentation for more details. Hope this is useful!

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

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

11 People are following this question.

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

Related Questions

Terrain collider only detects slow collisions. [VIDEO] 0 Answers

How do I restart a scene after a collision? 2 Answers

What's better? Multiple scenes or assigning layers? 2 Answers

How do I make a scene change when my Player collides with a item? 1 Answer

OnCollisionEnter acts weird when scene restarts? 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