Architecture

Pretend I don't know the first thing about making games

Recommended Posts

So...

 

It looks like Unity changed how text works between the time they published the tutorial for roll-a-ball and the release of 4.6. Somebody please help!

Share this post


Link to post
Share on other sites

So...

 

It looks like Unity changed how text works between the time they published the tutorial for roll-a-ball and the release of 4.6. Somebody please help!

If you are tring to access a variable from a new component, you need to write this at the top of the script:

using UnityEngine.UI

 

If that doesn't do the trick, here are the tutorials for the new ui system

http://unity3d.com/learn/tutorials/modules/beginner/ui

 

If that doesn't work (or you are in a hurry to feel a piece of success!) then state what the specific problem is.

For instance, if you tell me what step of the tutorial you are stuck on, I can try to see what I can do.

 

Share this post


Link to post
Share on other sites

It's the penultimate step of the roll-a-ball tutorial. The video asks you to create > GUIText, except that there is no function under the "create" menu called GUIText. Create > UI > Text adds other objects to the hierarchy not present in the tutorial.

 

Essentially, it looks like Unity modified how text works within the engine and failed to update their tutorials accordingly.

Share this post


Link to post
Share on other sites

It's the penultimate step of the roll-a-ball tutorial. The video asks you to create > GUIText, except that there is no function under the "create" menu called GUIText. Create > UI > Text adds other objects to the hierarchy not present in the tutorial.

 

Essentially, it looks like Unity modified how text works within the engine and failed to update their tutorials accordingly.

Everything you say here is true.

 

Still, you can complete the tutorial with the new UI system. 

1.Right click on the Hierarchy and select UI>Text

This will also populate the hierarchy with a Canvas and an Event System. The canvas has to be a parent of any of the new UI components. here is the tutorial that explains what the canvas does.

 

2.Click on the Text gameObject to highlight it in the inspector

 

3. Click on the Grid in the top left of the Rect Transform component.  Select the Top/Left option where the red dot is in the top left. This is putting the anchor point in the top left.

 

4.Then make PosX 100 pixels and the PosY -30 pixels. What we are doing here is putting the text 100 pixels to the right and 30 pixels below the anchor point. This video explains anchors in depth. 

 

This takes us to 3:40 of the Roll-A-Ball tutorial video.

 

5.At the top of the script it tells you to open, type 

 

using UnityEngine.UI;

 

This allows you to use the functions which access the new UI components.

 

6. Replace GUItext in the tutorial with Text

 

I think the rest of the tutorial will probably work from there. Just replace mentions of GUIText with Text.

 

I'm going to post this now then make sure I'm right. Probably not the best order, but I think you might be waiting.

Edit: The winText stuff is very similar, you just want to set the anchor in the center instead of in the upper right. If you have trouble doing that, I can tell you how.

 

I know it can be incredibly frustrating when you run into a bump like that. The question I found myself asking all the time was "How the fuck was I supposed to even know that I needed to know that?!" But at some point you will start to realize that you are getting better at recognizing what you need to know and how to find it. There is an enormous amount of resources available from the tutorials and Unity Answers. I still find myself rewatching teh begginner tutorial videos because there is a little piece of info that I never had a reason to remember, but watching through those videos the first time told me that these things exist and so I know where to start my search when I run into this type of problem. The reason I keep on telling everyone about including using UnityEngine.UI;  in the top of their script was because that took me a day and the reason it took me a day was because I didn't have any idea that the problem might be not including a namespace. I hadn't had that type of solution before. 

As they say in the Korean Dramas, "FIGHTING!"

Share this post


Link to post
Share on other sites

I actually moved on to the next tutorial and started making the Space Shooter. I don't know C# at all, but I'm starting to get an idea of how it works. I can imagine it would be useful to get a book on C# to read through to get a handle on basic programming (I've never done anything more involved than hand-coding HTML about 20 years ago)--perhaps I should take a class on C# or just programming languages in general.

 

Anyway, I will test your revamped tutorial bits when I get back from the gym. Thanks, clyde.

Share this post


Link to post
Share on other sites

Tom Francis, the guy who made Gunpoint, started a

. It uses Game Maker, and he assumes that you don't know the first thing about making games. It's pretty good from what I've seen so far. I think I'll try to cobble something together following this.

Share this post


Link to post
Share on other sites

(Weird aside: Tom Francis is my father's name--and my given name, though I go by Max--so every time someone talks about him, it makes me giggle.)

Share this post


Link to post
Share on other sites

I actually moved on to the next tutorial and started making the Space Shooter. I don't know C# at all, but I'm starting to get an idea of how it works. I can imagine it would be useful to get a book on C# to read through to get a handle on basic programming (I've never done anything more involved than hand-coding HTML about 20 years ago)--perhaps I should take a class on C# or just programming languages in general.

 

Anyway, I will test your revamped tutorial bits when I get back from the gym. Thanks, clyde.

 

If you want to get a handle on programming in general I can't recommend enough that you check out Processing and the tutorials on their website. Processing is a language that's very similar to C# and it's designed to be powerful but easy to grasp for beginners. There are some great tutorials for people who have never programmed on its website. If you want to get a more detailed introduction, check out the book Learning Processing by Daniel Shiffman.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now