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 berting01 · Jan 25, 2012 at 06:52 AM · sceneontriggerenterloadleveldontdestroyonload

how can i make my character to be on another scene?

I cant figure this out. For example, I enter to a portal, how will I make my character to be on the next scene?

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 syclamoth · Jan 25, 2012 at 07:00 AM 0
Share

Tagged 'unityanswers'. Seriously? That's probably the one thing less useful than a 'scripting' tag...

You could at least tag the question with the language you want your answers in. If you don't I'll just answer in C# (because it's my preference) and if you don't like it well too bad.

avatar image Lo0NuhtiK · Jan 25, 2012 at 07:01 AM 2
Share

Yeah, I've been deleting a lot of those kinds of tags lately trying to get rid of them.

1 Reply

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

Answer by syclamoth · Jan 25, 2012 at 07:04 AM

Make your portal a trigger. Then, on the portal gameObject, put a script that goes like this:

 void OnTriggerEnter(Collider other)
 {
     if(other.gameObject.tag == "Player")
     {
         DontDestroyOnLoad(other.gameObject);
         Application.LoadLevel("Next Level");
     }
 }

Of course, your character will remain in the same spot as the portal, so you might need something like this on the character script, as well:

 void OnLevelWasLoaded(int thisLevel)
 {
     transform.position = GameObject.FindWithTag("SpawnPoint").transform.position;
 }

This will teleport the player to an object tagged 'SpawnPoint' as soon as the level is loaded.

Comment
Add comment · Show 8 · 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 berting01 · Jan 25, 2012 at 07:15 AM 0
Share

ok thanks.. ill try this one

avatar image berting01 · Jan 25, 2012 at 02:22 PM 0
Share

is this java or c# script?

avatar image syclamoth · Jan 25, 2012 at 02:24 PM 0
Share

This is C#. Java is not supported by Unity.

avatar image Lo0NuhtiK · Jan 25, 2012 at 02:25 PM 1
Share

if you can't tell by looking at it or reading the comment @syclamoth posted at the top then throw it in a boo script.
Edit: Damn... you beat me typing lol

avatar image syclamoth · Jan 25, 2012 at 02:28 PM 2
Share

I should learn boo, just so I can answer every question in it and annoy everybody.

Show more comments

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

8 People are following this question.

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

Related Questions

Next LEVEL Load Problem. 2 Answers

Facebook posting problem in multiple scene architechture 0 Answers

Losing reference to the camera after loading new scene 0 Answers

my problem is a ontriggerenter new secene open,hello my problem is a 0 Answers

Change level upon clicking a gameobject 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