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 Morynalis · Jan 11, 2015 at 05:02 AM · collisionscene

How do I restart a scene after a collision?

I am creating a game, and I cannot find a way to restart a scene after a collision. I want to restart the scene when a ball collides with a different ball, I have tried many different scripts, but nothing I use works.

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
0

Answer by getyour411 · Jan 11, 2015 at 05:02 AM

http://answers.unity3d.com/questions/64395/reload-current-level-when-i-die.html

Asked/answered many time, please search first or better define what you have tried/why this is different than so many others like it.

Comment
Add comment · Show 7 · 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 Morynalis · Jan 11, 2015 at 05:25 AM 0
Share

Thanks for the help, but the script I created still is not working, and i can't figure out what is wrong.

pragma strict

function Start () { UnityEngine.Component; if (Collision.gameObject.name == "Ball") Application.LoadLevel(Application.loadedLevel); }

avatar image getyour411 · Jan 11, 2015 at 05:28 AM 0
Share

move that to Update, Start is only called once at instantiate unlikely the ball collision will be true at that point

avatar image Morynalis · Jan 11, 2015 at 06:10 AM 0
Share

it says Expressions in statements must only be executed for their side-effects. After applying what you said, I do not know how to fix that I am a novice at the whole coding thing

avatar image getyour411 · Jan 11, 2015 at 06:12 AM 0
Share

Show full code and apply 10101 formatting

avatar image Morynalis · Jan 11, 2015 at 06:16 AM 0
Share

It now says the reference script is missing. Is it obvious i have no idea what i am doing.

Show more comments
avatar image
0

Answer by Digital-Phantom · Jan 11, 2015 at 05:29 AM

I think it's your capitalisation. Shouldn't your Collision.gameObject.name blablabla actually be Collision.GameObject.name (swap your small g for a capital G)

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 getyour411 · Jan 11, 2015 at 05:35 AM 0
Share

I assumed this was pseudo code; OP look at this

http://unity3d.com/learn/tutorials/modules/beginner/physics/on-collision-enter

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to load a scene on collision 2 Answers

Scene Audio Script Error 2 Answers

moving to next scene 1 Answer

Endless DeathZone??!!? 4 Answers

Teleporter 2 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