• 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 · textmove2d-physicsboxcollider

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

find the tangent of a box / circle collider 0 Answers

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

Collider around GUI text 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges