Unity 3d Tutorial for Programmers - Part 13 - Finding Objects and GUIText

preview_player
Показать описание
Step by step directions on how to make a 2d-looking game using the 3d Unity Game engine, including how to use the physics engine.

Рекомендации по теме
Комментарии
Автор

Hi quill18. Just landed on one of your tutorials. You’re magic! I know nothing about C# but following you makes it very easy. Ok, you’re a bit fast some time but that is due to my lack of knowledge. I will look no further. Please do not disappear from the net as you are a valuable source of learning.

rockonjava
Автор

i've been trying if figure out how to call a function from a different script for the longest time. you're the best man.

VektorPizzaWolf
Автор

i really like people that teach stuff quickly! :D Thanks a lot man! really appreciate it.

LimeSlimez
Автор

Ouch, that took a while to figure out.  Unity5 has completely changed the way its UI works.Fortunately you can still create the legacy GUIText fields, but it's a little convoluted.The easiest way to follow Quill18's tutorial is go to GameObject, Create Empty, then click on Add Component in the inspector - Search for GUI and select GUI Text.  The tutorial steps can then be followed per the video.

Roundtablist
Автор

I have just spent the last hour scratching my head trying figure out how when all my code was exactly the same as yours (even in the download) I still could not figure out why I was getting errors, until I realized my paddle game object had a capital P and the code was using a lower case P instead.
On the plus side it does teach you the pitfalls involved for future reference.
Still good work, thanks.

markyj
Автор

For those of you having problems with the getting the script to work you need to do the following to the text to generate in Unity 5.5:

1) at the top of the paddle script add the line `using UnityEngine.UI;`
2) Where you want to change the text add the line `GameObject.Find = "Lives: " + lives;`

saaqibz
Автор

FYI for anyone else who is for some reason following in this in 2018/2019 unity. GUItext wont work as many people have stated.
--

You will need: to add using UnityEngine.UI; to the top of your script like so:


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
--
And then you will need the following in your spawn ball function:


lives--;

Text livesText = GameObject.Find ("livesText ").GetComponent<Text>();
livesText.text = "Balls:" + lives;
--
I had called the text element on my canvas "livesText"

marcuslane
Автор

3:11
I'm getting:

The referenced script on this Behaviour is missing!
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
PaddleScript:SpawnBall() (at
PaddleScript:Start() (at

ivanbssouza
Автор

Is it possible that you left a ball in your scene editor view?

quill
Автор

I'm so good at this every time  a new script is made I spend 30 minutes finding one missing semicolon XD. This time I even had to download your script to look at.

cremist
Автор

Actually, I had everything done, but when one person won, the other person's ball was still active. is there a way to remove all of the copies of the ball prefab?

ThethUSER
Автор

I'm stuck. I was making a pong / breakout crossover (just treat it as pong for this example). When it got to scoring, I was going to have 3 breakout lives, if your ball went into your own goal, and one pong live, then the score ticks over. when the score ticks over, it destroys both the balls and attatches them to you paddles again. How do you do this? I spent far too long trying to figure this out and would hate to see this project go down the drain.

ThethUSER
Автор

Hi, GREAT TUTORIAL.
I have a problem hoping you can help me.
I am already at part 13 of the tutorial and I have a problem.
When I launch the ball after it gets to the middle of the screen it starts spinning around itself. I tried the following: launch and hit bricks when the ball is going up, launch the ball and bounces against the walls when it comes back down to the middle starts spinning, even if the ball bounces on the wall and upper bricks in the middle it spins also. Any ideas?

danielben-shabtay
Автор

My GUI Text objects don't show up, both in the editor and when I run the game. They're also no longer in screen coordinates (1.0, 1.0 is almost centered on the screen). I don't believe the new UI is out yet, but there definitely seems to be a change, and I can't find anything to explain why the GUI Text wouldn't be rendering.

MichaelPateras
Автор

can you help me please I have errors with your script. 1. Assets/brick.cs(33, 32): error CS0428: Cannot convert method group `Find' to non-delegate type `paddlescript'. Consider using parentheses to invoke the method

2. Assets/brick.cs(34, 27): error CS0246: The type or namespace name `PaddleScript' could not be found. Are you missing a using directive or an assembly refere

aliahmad-zzwv
Автор

help me plz i have reference not set to an instance of an object paddleScript.Start() ....

yashfaashraf
Автор

The only unfortunate part about your series is that as the project nears completion, you forget that we're all probably beginners here. It would be better to delve into WHY you do some of things instead of just doing them. Any script kiddie can jump into the asset stored and get a semi to fully completed game architecture and make it their own, the rest of us want to LEARN how to do this stuff

GuidezGames
Автор



3.Assets/brick.cs(35, 26): error CS0103: The name `paddleScript' does not exist in the current context

Thanks for the help nice tutorial.

aliahmad-zzwv
Автор

Can anyone help me with GUI one? I am getting error MissingComponentException: There is no 'GUIText' attached to the "guiLives" game object, but a script is trying to access it.
You probably need to add a GUIText to the game object "guiLives". Or your script needs to check if the component is attached before using it.

And i am doing it in unity 4.6. Can you help me out?

farhanhasib
Автор

Turn on The Youtube Subtitles 8:15 to 8:40 LMFAO

froschprojekte
visit shbcf.ru