Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 ThatOwlGuy · Oct 27, 2012 at 08:26 AM · guigameobjectfunctioninterface

command system with 3d gui interface

I just want to get on track with making an effective attack command system that sets a certain gameobject to be produced based on which move is assigned to which button. I also have included the 3d menu which does not use the the built in unity gui ( i personally find it a bit confusing and think that 3d menus and interfaces would look cooler anyway). So here is a quick draft of what I want to achieve that I emailed to myself via cellphone earlier today. Tell me what you think and give feed-back on whether or not this would be applicable. i would test it now but my computer basically died but I still want to continue progress with my idea as it is intended for a competition that is due in January. here is the code

 var fire : gameobject;
 var water: gameobject;
 var rock: Rigidbody;
 var move1: gameobject;
 var move2: gameobject;
 var move3: gameobject;
 var menu: gameobject;
 var movenum = 1;
 
 functionUpdate(){
 
 if(Input.GetButtonDown("Select"){
     var 3dgl = gameobject.find("3dGUILocation");
     instantiate(menu, 3dgl.transform, 3dgl.position);
     function(movechoose);
 }
 
 if(Input.GetButtonDown("X")){
     instantiate(move1, lp.transform.position, lp.transform.rotation);
 }
 if(Input.GetButtonDown("Y")){
     instantiate(move2, lp.transform.position, lp.transform.rotation);
 }
     if(Input.GetButtonDown("B")){
     instantiate(move3, lp.transform.position, lp.transform.rotation);
 }
 }
 
 function(movechoose){
     var fe = gameobject.find("fire emblem");
     var we = gameobject.find("water emblem");
     var re = gameobject.find("rock emblem");
 
     if(GetAxis("Horizontal") >= 0.5){
         movenum +=1;
         if(movenum ==4){
             movenum = 1;
         }
     }
     if(GetAxis("Horizontal") <= -(0.5)){
         movenum -=1;
         if(movenum ==0){
             movenum = 3;
         }
     }
         if(movenum==1){
             fe.animation.Play("jig");
             print("do you want to select the fire attack?");
             if(Input.GetButtonUp("A"){
                 fe.animation.Play("rumble");
                 print("which button do you want to assign it too?");
                 if(Input.GetButtonDown("X"){
                 move1 = fire;
                 }
                 if(Input.GetButtonDown("Y"){
                     move2 = fire;
                 }
                 if(Input.GetButtonDown("B"){
                     move3 = fire;
                 }
             }
         }
     }
         if(movenum==2){
             we.animation.Play("jig");
             print("do you want to select the water attack?");
             if(Input.GetButtonUp("A"){
                 we.animation.Play("rumble");
                 print("which button do you want to assign it too?");
                 if(Input.GetButtonDown("X"){
                     move1 = water;
                 }
             if(Input.GetButtonDown("Y"){
                 move2 = water;
             }
             if(Input.GetButtonDown("B"){
                 move3 = water;
             }
         }
     }
         if(movenum==3){
             re.animation.Play("jig");
             print("do you want to select the rock attack?");
             if(Input.GetButtonUp("A"){
                 re.animation.Play("rumble");
                 print("which button do you want to assign it too?");
                 if(Input.GetButtonDown("X"){
                     move1 = water;
                 }
                 if(Input.GetButtonDown("Y"){
                     move2 = water;
                 }
                 if(Input.GetButtonDown("B"){
                     move3 = water;
                 }
             }
         }
     }
 }
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 Fattie · Oct 27, 2012 at 09:07 AM 0
Share

you would really do better on the forum.

good luck with your project. if you have any specific technical woes, ask here! forum for discussion

avatar image ThatOwlGuy · Oct 27, 2012 at 01:27 PM 0
Share

thank you, will do.

0 Replies

· Add your reply
  • Sort: 

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

10 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

Related Questions

Using GUI and check what button was pressed 1 Answer

What Is Lighter GameObject or Rect 1 Answer

Game Object enable for game mode selection on GUI 1 Answer

Check if GameObject.Find returns null 1 Answer

GUI Window on GameObject location? 1 Answer


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