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 Bobby Stillz · Apr 08, 2011 at 05:35 AM · guigameobjectbuttoncharacterselection

Char select / GUI button question.

Hey guys,

I've created a screen of character picture buttons

I want these buttons to correspond with a gameobject. Then I want said gameobject to be taken into the next scene on click.

I'm in a pretty big rush to get this finished, any help would be highly appreciated.

thanks!

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 KeithK · Apr 08, 2011 at 06:18 AM 0
Share

Ok... and what exactly is the problem?

avatar image Bobby Stillz · Apr 08, 2011 at 06:23 AM 0
Share

I Can't figure out how to correspond a gameobject with a button click.

3 Replies

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

Answer by Meltdown · Apr 08, 2011 at 09:27 AM

Take a look at GameObject.Active

When you are showing your GUI buttons, deativate all your characters, and when you click on the relevant GUI button, simply activate the character/camera in your scene you want to play with.

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
avatar image
0

Answer by seyyid · Apr 08, 2011 at 07:08 AM

as i understand u basically have gui buttons with texture of character pictures and when you click on these pictures you want it to load next scene? if yes control of your gui button is as follows;

public Texture picturetexture;

void OnGUI(){

if(GUI.Button(new Rect(10, 10, 50, 50), picturetexture)) Application.LoadLevel(1); // in bracket you type your scene name or level number

}

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 Bobby Stillz · Apr 08, 2011 at 07:11 AM 0
Share

Thanks for responding!

I would like for each button to correspond with a unique gameobject. So when you click that button, your controllable character is who you picked.

avatar image seyyid · Apr 08, 2011 at 07:33 AM 0
Share

hmm if you dont have too many character the simplest way to do it may be setting separate scene for each character and use the code above to load scenes for each character but if you have too many characters it is silly way to do this method because once you want to build it ll be hard for unityengine to build each scene one by one you can dig this thread if you like http://answers.unity3d.com/questions/47753/choosing-from-multiple-characters

avatar image
0

Answer by zmar0519 · Apr 08, 2011 at 10:09 AM

I suggest that you look into key binders, like the one in the bootcamp demo for the gun manager. That way you could make a spot for the icon, and the gameObject. After that, use don't destroy on load. Recap: there is a key binder that has spots for a gameobject and an icon, and when the player presses the gui button, it adds a dontdestroyonload script. Good Luck :)

ps: when you are done with your immediate problem, you should edit you question so that it doesn't say "Urgent"

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

Using GUI and check what button was pressed 1 Answer

Searching for gameobjects with a tag and creating a button for each one? 1 Answer

Problem with texture to reset and re-enter the same texture 0 Answers

Is it possible to link a UI element to a gameobject? 1 Answer

GUI Button follow GameObject, like floating button how to on C++? 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