- Видео 8
- Просмотров 36 188
AlexJDev
Великобритания
Добавлен 20 мар 2014
Returning soon.. stay tuned.
How to output MESSAGES to CONSOLE in Unity! [BEGINNER TUTORIAL]
Learn how to output key information, warnings, and errors into the console so you can figure out what is happening in your Unity game!
RICH TEXT DOCS: docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/StyledText.html
RICH TEXT DOCS: docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/StyledText.html
Просмотров: 598
Видео
Generate USERNAMES RANDOMLY In Unity! [INTERMEDIATE TUTORIAL]
Просмотров 8922 года назад
Learn how to generate usernames through an animated UI, similar to fall guys! This tutorial will teach you from scratch how to implement everything you need! If you have any questions or topics you'd like me to cover, be sure to put them in the comments below!
How To Make HANGMAN in Unity! [FULL GAME TUTORIAL]
Просмотров 6 тыс.2 года назад
Learn how to make the popular game Hangman from scratch in unity! This tutorial will teach you from scratch how to create a fully fledged unity game in just half an hour! Download Assets: drive.google.com/file/d/175Xqbo6p-Yi8M96H5pt2Ox-Fh4KTdjF_/view?usp=sharing Dynamic Scrollable UI: ruclips.net/video/U9zdiT8zuJQ/видео.html
Three Ways To DESTROY things In Unity! [BEGINNER TUTORIAL]
Просмотров 502 года назад
Learn how to destroy objects in unity through buttons and code! Chapters: 0:00 Destroy through button 1:22 Destroy the current script 2:12 Destroy the current Object
Keep GameObjects/Scripts Between Scenes In Unity The CORRECT way! [BEGINNER TUTORIAL]
Просмотров 4552 года назад
Learn how to keep objects and scripts between scenes the CORRECT way to prevent duplication and wasted resources! This tutorial uses the DontDestroyOnLoad function! Change Scene Tutorial: ruclips.net/video/2z4nfXNcp2s/видео.html&ab_channel=ImNotAlexx Chapters: 0:00 Introduction 0:19 Creating the Script 2:48 Testing the Script
How To Make PONG in Unity! [FULL GAME TUTORIAL]
Просмотров 28 тыс.2 года назад
Learn how to make a fully working Pong game in Unity within 30 minutes with this beginner guide! Assets Download: drive.google.com/file/d/1VfwIRqDaxyp-t7_1nubnTiTgwLJrqAHz/view?usp=sharing
Create a DYNAMIC Scrollable UI in Unity! [BEGINNER TUTORIAL]
Просмотров 3792 года назад
Create an expandable, dynamic UI element which can contain objects and be scrolled to uncover more! Chapters: 0:00 Intro 0:10 Create The Scrollable UI! 3:50 Add Objects Through Code!
Change Scenes In Unity With THREE Different Methods! [BEGINNER TUTORIAL]
Просмотров 5682 года назад
Learn how to change scenes in unity quickly with THREE different methods which can be applied to any game/scenario. Chapters: 0:00 Change Scene Through Index Number 3:12 Change Scene By Scene Name 4:09 Change Scene through Triggers/Collisions
i hope you get menotized soon
Ive finished watching your video and successfully made it work but how do i add hints?
Geniunely, taught be so much about those damn voids that I didn't understand at all. great video all-around <3
Old video so understand maybe a delay in response. But after the prefabs are added to the container via script, the pivot point is not updated to start the scroll from the top. How would I implement this? Thanks
I tried this , but in game ball doesn't move until I tried to move it by scene what problem is this
Decided to recreate Pong with extras. I know Unity basics and I’m an experienced developer so didn’t look at any tutorials. Now checking tutorials after finishing basic game and liking those that did much the same as me so that’s a 👍 for this one. Only criticism, if ( isTutorial ) playBackgroundMusic = false;
Can I have the ball movement code ?
rlly bad tutorial nothing works i wrote the script exactly the same (wld u be able to give me the script code)
By ‘nothing works’ what’s the actual error? You must have not followed it correctly. I recommend thinking about what’s not working and figuring out why as that’ll teach you much more than me just giving you the code. I can assure you though, the code in the tutorial and the instructions work :)
@@AlexJDev the word container does not work and the game doesnt restart after i lose or win and the keyboard doesnt work the error say "game object has been destroyed" also the word u hve to guess does not show
@@AlexJDev The script i wrote: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; using System.Runtime.CompilerServices; using UnityEditor.SceneManagement; public class HangmanController : MonoBehaviour { [SerializeField] GameObject wordContainer; [SerializeField] GameObject keyboardContainer; [SerializeField] GameObject letterContainer; [SerializeField] GameObject[] hangmanStages; [SerializeField] GameObject letterButton; [SerializeField] TextAsset possibleWord; private string word; private int incorrectGuesses, correctGuesses; void Start() { InitialiseButtons(); InitialiseGame(); } private void InitialiseButtons() { for (int i = 65; i <= 90; i++) { CreateButton(i); } } private void InitialiseGame() { //reset data back to original state incorrectGuesses = 0; correctGuesses = 0; foreach(Button child in keyboardContainer.GetComponentsInChildren<Button>()) { child.interactable = true; } foreach(Transform child in wordContainer.GetComponentsInChildren<Transform>()) { Destroy(child.gameObject); } foreach(GameObject stage in hangmanStages) { stage.SetActive(false); } //generate new word word = generateWord().ToUpper(); foreach(char letter in word) { var temp = Instantiate(letterContainer, wordContainer.transform); } } private void CreateButton(int i) { GameObject temp = Instantiate(letterButton, keyboardContainer.transform); temp.GetComponentInChildren<TextMeshProUGUI>().text = ((char)i).ToString(); temp.GetComponent<Button>().onClick.AddListener(delegate { CheckLetter(((char)i).ToString()); }); } private string generateWord() { string[] wordList = possibleWord.text.Split(" "); string line = wordList[Random.Range(0, wordList.Length - 1)]; return line.Substring(0, line.Length - 1); } private void CheckLetter(string inputLetter) { bool letterInWord = false; for(int i = 0; i < word.Length; i++) { if (inputLetter == word[i].ToString()) { letterInWord = true; correctGuesses++; wordContainer.GetComponentsInChildren<TextMeshProUGUI>()[i].text = inputLetter; } } if (letterInWord == false) { incorrectGuesses++; hangmanStages[incorrectGuesses - 1].SetActive(true); } CheckOutcome(); } private void CheckOutcome() { if(correctGuesses == word.Length) //win { for(int i = 0; i < word.Length; i++) { wordContainer.GetComponentsInChildren<TextMeshProUGUI>()[i].color = Color.green; } Invoke("InitialiseGame", 3f); } if(incorrectGuesses == hangmanStages.Length) //lose { for (int i = 0; i < word.Length; i++) { wordContainer.GetComponentsInChildren<TextMeshProUGUI>()[i].color = Color.red; wordContainer.GetComponentsInChildren<TextMeshProUGUI>()[i].text = word[i].ToString(); } Invoke("InitialiseGame", 3f); } } }
Such a good video with best explanation!!! You got a new Subscriber and hope so you will start posting again :)
Thanks man! I’m working on a new video and should be regularly uploading soon!
text doesnt change when i make a goal and the ball doesnt resets sorry for my english im german
4:27
Just wanted to share my stupidity here lol when I got to the Invoke method part of typing in Invoke("StartBall", 2f); and it wouldn't work meaning the ball never moved. I went back to see if I missed something, and I was like "I literally did this to the tee! So what the fuck is the problem here?" I spent the last three days learning all that I could about the Invoke method and its limits and even coroutines, and a couple minutes ago I watched this video again and realized....I typed in "Startball" instead of "StartBall".......I forgot to capitalize the B....and then the ball moved lmaoo three days to just figure out it was that. Wanted to share that. Great video! My mistake helped me learn more.
Congratulations! You got a new subscriber! Now you have 158
love you (no homo)
Thank you so much it took a while to figure out what was going on but I made the game with your help thank you
It works. To sleepy to write a longer comment.
Currently 16 minutes in, is it normal for me to have a ton of compiler errors in the script at this point?
My ball wont start and I’m not exactly sure why. I have no error in my code but it just won’t work
Make sure u wrote the function name correctly
Ball ❌️ Bull ✅️ Thank You for this tutorial 🙏🏽
THANK YOUUUUUUUUU
Amazing video! I followed it and felt like I learned so much, however, the music drove me crazy.
i only have one tip. ctrl mouse wheel in vs. had to break out my magnifying glass. but great stuff i needed the platform movement for something
12:12 - the reason my ball was not bouncing was because i didnt add the ball material. so that is why i was stuck. heres the code, cause this fool doesnt understand the concept of zoom or how to enlarge the IDE. PlayerMovement Script 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { [SerializeField] private float movementSpeed; [SerializeField] private bool isAI; [SerializeField] private GameObject ball; private Rigidbody2D rb; private Vector2 playerMove; void Start() { rb = GetComponent<Rigidbody2D>(); } // Update is called once per frame void Update() { if (isAI) { AIControl(); } else { PlayerControl(); } } private void PlayerControl() { //This controls the paddle somehow playerMove = new Vector2(0, Input.GetAxisRaw("Vertical")); } private void AIControl() { if(ball.transform.position.y > transform.position.y + 0.5f) { playerMove = new Vector2(0,1); } //This used to have a minus sign which for some reason caused the enemy AI to spaz out at the middle, so keep it at plus. //This causes the enemy AI to follow the ball like a laser guided missle. This is crazy man. It's like magic. else if(ball.transform.position.y < transform.position.y - 0.5f) { playerMove = new Vector2(0, -1); } else { playerMove = new Vector2(0, 0); } } private void FixedUpdate() { rb.velocity = playerMove * movementSpeed; } } BallMovement Script 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BallMovement : MonoBehaviour { [SerializeField] private float initialSpeed = 10; [SerializeField] private float speedIncrease = 0.25f; [SerializeField] private Text playerScore; [SerializeField] private Text AIScore; private int hitCounter; private Rigidbody2D rb; // Start is called before the first frame update void Start() { rb = GetComponent<Rigidbody2D>(); Invoke("StartBall", 2f); } private void FixedUpdate() { rb.velocity = Vector2.ClampMagnitude(rb.velocity, initialSpeed + (speedIncrease * hitCounter)); } private void StartBall() { rb.velocity = new Vector2(-1, 0) * (initialSpeed + speedIncrease * hitCounter); } private void ResetBall() { rb.velocity = new Vector2(0, 0); transform.position = new Vector2(0, 0); hitCounter = 0; Invoke("StartBall", 2f); } private void PlayerBounce(Transform myObject) { hitCounter++; Vector2 ballPos = transform.position; Vector2 playerPos = myObject.position; float xDirection, yDirection; if(transform.position.x > 0) { xDirection = -1; } else { xDirection = 1; } yDirection = (ballPos.y - playerPos.y) / myObject.GetComponent<Collider2D>().bounds.size.y; if(yDirection == 0) { yDirection = 0.25f; } rb.velocity = new Vector2(xDirection, yDirection) * (initialSpeed + (speedIncrease * hitCounter)); } private void OnCollisionEnter2D(Collision2D collision) { if(collision.gameObject.name == "Player" || collision.gameObject.name == "AI") { PlayerBounce(collision.transform); } } private void OnTriggerEnter2D(Collider2D collision) { if(transform.position.x > 0) { ResetBall(); playerScore.text = (int.Parse(playerScore.text) + 1).ToString(); } else if(transform.position. x < 0) { ResetBall(); AIScore.text = (int.Parse(AIScore.text) + 1).ToString(); } } }
Thank you so much!!!!!!!😀😀😀
its not even letting me import the files (sfm all over again)
Why can I not move my paddle at all?
make sure vertical is capitalized "Vertical"
I've written the player movement script exactly the same but the movement: isAI: and Movement Speed: are just not showing up as variables. What have I done wrong?
Same happened to me
make the isai and movement speed public!
why font so small,i can not see anything
Click on playerscore/ aiscore and make the scale bigger
Womp womp
@@RicFF13 kid
Why does the ball stop dead on when it comes in contact with my racket or the wall?
Have you addded the bounce physic to the gameObject?
same here, can you please give the solution
do you have this code
I need a magnifying glass to be able to see what you wrote in the script, you could repeat the tutorial, but next time, when you work with the script, use scroll to enlarge the view... :))))
Hello, your video was awesome. Good job!. I totally agree with creating a part two, you can add longer words and spaces
My player doesnt move when i press any keys did i do something wrong
did you fix it?
@@reps2564 no i gave up especially since my uni switched to unreal engine sorry i cant provided tips
@@reps2564 If you are still working on it change ("vertical") in visual studio code to ("Vertical") also make sure you go to (in the unity editor) edit => project settings => input manager => axes => vertical, and make sure that is is defined as Vertical and also that your "w" and "s" keys are binded hope this helps
@@reps2564 try writing the code again fixed for me
love the minecraft bg music
why my word container already destroy at start?
Hi! I haven’t uploaded in a while but am looking to get back into the channel *soon*. Thanks for all the feedback, my apologies for how small the text is in vscode. Will definitely look at changing this next time! My style is going to change to more of a devlog with all code provided via GitHub at the end :)
thanks Respected tutor
Hope you come back soon!
@@danthon1267do u know what he used to when he set up the project like a 2d or 3D
Not really a tutorial since we just follow directions but great anyways 👍
Why i can't get the same canvas as yours
This tutorial Was awsome Thank you so much
Bro why? Tutotial is good but I can't see any codes? they are very smaii
fullscreen and squinting helps but my eyes hurt now
It is not doing the scoring part it just bounces off of it
if it's bouncing off the sides, it means that the 'startball' function isn't even triggering. It might be because you used onCollisionEnter instead of onCollision2D, or you might've messed up setting the triggers themselves. if you're talking about the paddles they're changing the speed not the score. vague question tho
@@chumleechumbucket6625 ya sorry it is speeding up by the paddles but when it hits the walls behind the paddles it does not change the score or reset
@@Reklaw096 in that case it either means you didn't set up the triggers or the ontriggerenter function properly. Double check that they're both set to 2D, that can be an issue
@@chumleechumbucket6625 ok thanks I will try to see if that works later
I'm blind like a mole, why didn't you make the code's font bigger 😑 But thank you tho, I'd been searching for this part with the ball going any direction depending on the angle!
hey 👋 people are kinda right... ur speed isnt the issue cuz i can pause it, but u dont explain what things do. also u can increase writing size in VS code - so PLEASE do it for future tutorials if u still make them that is otherwise great video - loads of effort put into it idk if the game works or not cuz i didnt finish it - i cant see some of the stuff u type but the vid is nice, just work on these things maybe ^ GL 🥰
really bad tutorial. you're going too fast and dont explain half of the things...
This was pretty easy to follow for me. You can rewind if you miss something.
@@2010platinumstar At the time, I didn't really understand C#, because I thought I don't really need much knowledge about it because C# and Unity's C# are somewhat different. From then I've finished with learning C#, but I gave up on Unity because of the newest update. So, I would say that my lack of understanding C# did a pretty big part in not knowing what to do, but I can't really say he did a great job on this video.
Is their a way of implementing a while loop to this so that it ends after the players or the AIs score reaches a certain number. And if there is could I have help with it please as I'm not sure how while loops work in unity. Thankyou in advance.
you could put in if statements when it increases the score (more efficient than loops) and if the player/ai score is over a certain number you can run SceneManager.LoadScene(x); with x being the "name" or scene number. To use this, you'll have to state 'using UnityEngine.SceneManagement;' at the top. Then make 2 new scenes, one with some text saying you won and the other saying you lost, and maybe a replay button. I'm late to this and new to coding so you probably figured out something better already lol
Also, when the ball hits my side, the counter doesnt go up... why?
What's the background music?
otherside from minecraft
why did u quit?
Sorry! I’ve been quite busy the past year. Will be looking at starting again in a different format shortly :)
Besides the fact that you went a bit fast, and I got confused a couple times, I've had this issue so many times before, its not detecting the collision
what does else { Destroy(gameObject); } do here? because i tried leaving it out and it still works.... as far as i'm aware the "private static" already takes care of the duplicates