• 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 importguru88 · Sep 27, 2016 at 03:23 AM · text2d-physicsmoveboxcollider

How do I move text / call a 2d box collider in unity 3d

I just only want to keep the text . I don't want the going button because when I play the scene it takes up most of the scene . I am going to have a box collider surround the text so I am able to touch text and switch scenes here is what I got for code :

 using System.Collections;
 using GooglePlayGames;
 using UnityEngine.SocialPlatforms;
 
 public class lok : MonoBehaviour
 {
 
   public GUISkin skin;
   public int incrementalCount = 5;
 
   //leaderboard strings
   private string leaderboard = "Your unique leaderboard id";
   //achievement strings
   private string achievement = "Your unique achievement id";
   private string incremental = "Your unique achievement id";
 
   // Use this for initialization
   void Start()
   {
     PlayGamesPlatform.Activate();
   }
 
   // Update is called once per frame
   public void OnGUI()
   {
     GUI.skin = skin;
     skin.button.fixedWidth = Screen.width - 25;
     skin.textField.fixedWidth = Screen.width - 25;
     GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height));
 
     GUILayout.BeginVertical("box");
 
     GUILayout.Label("Official Google Play Games Services");
 
     GUILayout.Space(20);
 
     //Share Status
     if (GUILayout.Button("Log In"))
     {
       Social.localUser.Authenticate((bool success) =>
       {
         if (success)
         {
           Debug.Log("You've successfully logged in");
         }
         else
         {
           Debug.Log("Login failed for some reason");
         }
       });
     }
 
     GUILayout.Space(20);
 
     //Achievement
     if (GUILayout.Button("Unlock Achievement"))
     {
       if (Social.localUser.authenticated)
       {
         Social.ReportProgress(achievement, 100.0f, (bool success) =>
         {
           if (success)
           {
             Debug.Log("You've successfully logged in");
           }
           else
           {
             Debug.Log("Login failed for some reason");
           }
         });
       }
     }
 
     GUILayout.Space(20);
 
     //Incremental Achievement
     if (GUILayout.Button("Press " + incrementalCount + "more times to unlock incremental acheivment"))
     {
       if (Social.localUser.authenticated)
       {
         ((PlayGamesPlatform)Social.Active).IncrementAchievement(incremental, 5, (bool success) =>
         {
           //The achievement unlocked successfully
         });
       }
     }
 
     GUILayout.Space(20);
 
     //Leaderboard
     if (GUILayout.Button("Post your 5000 points to the leaderboard"))
     {
       if (Social.localUser.authenticated)
       {
         Social.ReportScore(5000, leaderboard, (bool success) =>
         {
           if (success)
           {
             ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(leaderboard);
           }
           else
           {
             //Debug.Log("Login failed for some reason");
           }
         });
       }
     }
 
     GUILayout.Space(20);
 
     // Show Leaderboard
     if (GUILayout.Button("Show Leaderboard"))
     {
       Social.ShowLeaderboardUI();
     }
 
     GUILayout.Space(20);
 
     //Show Specific Leaderboard
     if (GUILayout.Button("Show Specific Leaderboard"))
     {
       ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(leaderboard);
     }
 
     GUILayout.Space(20);
 
     //Show Achievments
     if (GUILayout.Button("Show Achievments"))
     {
       Social.ShowAchievementsUI();
     }
 
     GUILayout.Space(20);
 
     //Sign Out
     if (GUILayout.Button("Sign Out"))
     {
       ((PlayGamesPlatform)Social.Active).SignOut();
     }
 
     GUILayout.EndVertical();
     GUILayout.EndArea();
   }
 }
 
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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

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

Related Questions

Create a glossary using Simple JSON, loading data dynamically 1 Answer

How to move GUI elements like text in game (Like Star Wars Intro) 1 Answer

how to transport a character control? 1 Answer

find the tangent of a box / circle collider 0 Answers

Collider around GUI text 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