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 zeuo · Jan 13, 2011 at 05:19 PM · playerloadlevelcreate

create an object at loadlevel

so i have this script that creates a player after starting a level but the player dosnt work i dont think anything in the player is working. the player has a rigidbody and when he is created hes just standing in the air and dosnt fall. is there a way to get the player to work.

static var one: boolean = false; var characterone:Transform;

function Update () { if(one) {
Application.LoadLevel(1); var player= Instantiate(characterone, GameObject.Find("startpoint").transform.position, Quaternion.identity); }
}

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

Answer by Borgo · Jan 13, 2011 at 05:34 PM

you don't need to instantiate a object, just put it in the scene, wherever you want.

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 Justin Warner · Jan 13, 2011 at 05:43 PM 0
Share

What Borgo means, to go on it, is, you dont instantiate the player, you just drag the player in the scene, and it automatically does everything, so put the character in the scene, and then start the scene, it'll work.

avatar image Borgo · Jan 13, 2011 at 05:51 PM 0
Share

Thanks, I edited my answers, my english is not very good. :)

avatar image zeuo · Jan 13, 2011 at 07:27 PM 0
Share

no u see that will not work because in the first level u can select what character u want to play as then the second level starts with the player that u have selected, thats my game. but its not working i can select the player move on to the next level but then the character doesn't work

avatar image
0

Answer by DaveA · Jan 13, 2011 at 08:34 PM

Not sure on this, but LoadLevel will load the level, right? And start scripts in THAT level. So why not have a Start or Awake function in the next level instantiate your player? If you need to port variables (like 'player preference') from scene to scene, the easiest way is PlayerPrefs http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html

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

No one has followed this question yet.

Related Questions

help loading level after destroying objects 1 Answer

Next LEVEL Load Problem. 2 Answers

Tagged Load level 1 Answer

Two player collision ? 1 Answer

Death scene/screen on player Health Script Wont work! 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