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
1
Question by maxrio · Feb 19, 2015 at 12:48 AM · guitextspaceshooter

Project: Space Shooter - GUIText vs UI/Text in Unit3D 4.6

Greetings. I am following the lessons of "Project: Space Shooter" but in chapter 1 in Lesson 15 I am not able to continue. The command "GUIText" is not available in version 4.6. Only the command "UI/Text" and does not accept the parameters correctly. How can I solve this? Thank you for your attention. alt text

cap1-les15.jpg (53.0 kB)
Comment
Add comment · Show 1
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 maxrio · Feb 20, 2015 at 12:25 PM 0
Share

Thanks for your help. The first solution to use the "Empty Game Object" and then the GUIText was perfect. After completing the tutorial will learn better how to adapt to "UI.Text". Thank you all.

2 Replies

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

Answer by Rtyper · Feb 19, 2015 at 01:22 AM

The old style GUIText and GUITexture components are still available (for legacy purposes), though you can't create them from the GameObject menu anymore.

You can create an empty GameObject from there, and add a GUIText component from the Component/Rendering menu to continue with the tutorial. You may want to look at some of the tutorials on the new 4.6 UI system and try to adapt the Space Shooter tutorial to that though - it's definitely much more flexible than GUIText, and is still being updated.

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
11

Answer by DiegoSLTS · Feb 19, 2015 at 01:42 AM

There's nothing to "solve", the tutorial is outdated and what it tells you to do it's not available. You can still use the legacy GUI through code, but that's more complicated than what the tutorial is trying to teach you.

The new Text object has a lot of new options, if you want to get the same result as the tutorial do this:

  1. Set the Text anchor to top-left. On the inspector you'll see it has a Rect Transform instead of the normal Transform, the anchor can be set clicking on the icon at the top left of the Rect Transform component. Click on that icon and you'll see a table of different anchors.

  2. Set the pivot of the Rect Transform to x = 0, y = 1. The pivot is the point that's used as referente for positioning the object. x = 0 means the left of the rectangle, y = 1 means the top.

  3. If you try different anchors you'll see the values at the right change, for some options you'll see "top, bottom, left, right", for others "pos x, pos y, width, height" and for others any combination of those (pos z is always there). With the anchor set as step 1 you should see "pos x, pos y, width, height" options. When you see "pos x" and "pos y" they work like the pixel offset in the legacy GUI.

Later in the script you need a reference to the Text object. Instead of using GUIText you need Text, but to be able to type "Text" as a type you first need to add a using for the UI namespace. Add this line right after "using UnityEngine;":

 using UnityEngine.UI;

You can follow the tutorial from here.

Comment
Add comment · Show 1 · 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 efraibo · Oct 28, 2015 at 01:28 PM 0
Share

Someone managed solve this problem ?

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

"AI"/Behaviour for a Waypoint system 1 Answer

3D spaceshooter : targeting system 3 Answers

Strategies for Physics-based Movement for 2D Space RTS Controls? 1 Answer

[2D] How to instantiate laser when player rotates? 1 Answer

Shooting Lasers 3 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