3D ENDLESS RUNNER IN UNITY - COINS (Pt 4)

  Рет қаралды 30,597

Practical Programming

Practical Programming

3 жыл бұрын

Playlist: bit.ly/endless-runner-in-unity
Github: github.com/SK-Studios/3D-Endl...
In the fourth part of this beginner series on creating a 3D endless runner in Unity, we will be creating coins. We will make a score counter to keep track of the player's score, as well as create a UI so that the player can see their score as they are playing.
.............................................................................................
All Unity Tutorials: bit.ly/all-unity-tutorials
Beginner Unity Tutorials: bit.ly/unity-beginner-tutorials
Intermediate Unity Tutorials: bit.ly/unity-intermediate-tut...
Main Menu in Unity: bit.ly/unity-main-menu
Endless Runner in Unity: bit.ly/endless-runner-in-unity
.............................................................................................
♥ Subscribe: bit.ly/sk-studios-youtube
● Instagram: / _skstudios_
● Itch: sk-studios.itch.io
..............................................................................................

Пікірлер: 65
@TheRealKaiProton
@TheRealKaiProton 2 жыл бұрын
Only Just found this channel today, so Ive worked through to this point, its really great, because of the pace and explanation, Ive been able to change my Capsule to a model of a car, the floor texture to a road, and the obstacles to other cars, yay!! and I added extra colliders on the outside of the road, so no more falling off.. at least until the jumping video comes along!
@tryan0
@tryan0 2 жыл бұрын
This guy is cool! Teach me your ways of how you got this knowledge! It’s always the underdogs with the great content. Keep it up.
@amdphen
@amdphen 2 жыл бұрын
Amazing tutorials bro. You teach very well. Please make more. 👍🏻
@user-we6si4mi3x
@user-we6si4mi3x 2 жыл бұрын
everything is very detailed and clear, thanks for the lesson!
@PracticalProgramming
@PracticalProgramming 2 жыл бұрын
You're very welcome!
@shashanktambe6341
@shashanktambe6341 Жыл бұрын
On newer version of unity or if you selected mobile 3d template while creating project you might encounter this problem : "object reference not set to an instance of an object unity" to fix this "right click on hierarchy > UI > Legacy > Text" and then follow the video from 18: 43
@shashanktambe6341
@shashanktambe6341 Жыл бұрын
the problem was i selected text mesh pro and the ScoreText field is set to accept only text input , so it wont accept text mesh pro, only legacy text
@vargasxr421
@vargasxr421 2 жыл бұрын
VERY COOL the GetRandomPointInCollider function has a recursive approach very nice!
@PracticalProgramming
@PracticalProgramming 2 жыл бұрын
Thanks for the feedback, it's great to hear 😁😁 Implementing physics on the bullets would be great to do, and something I'm keen on doing, but this year has been pretty hectic with the final year of highschool and preparing for exams, so I've taken a break from making videos until it's all over 😅. If I start again after this year, I'll definitely keep that in mind though :)
@caaccaac8712
@caaccaac8712 3 жыл бұрын
Good work man.
@PracticalProgramming
@PracticalProgramming 3 жыл бұрын
Thanks :)
@hexteriaenrage1268
@hexteriaenrage1268 3 жыл бұрын
Would you be able to explain to me what Singletons are, as I am planning on using the knowledge I learn from this series to develop my own, more advanced game. Thanks in advance!
@BassJunkeeZ
@BassJunkeeZ Жыл бұрын
Bro, you are the best.
@PracticalProgramming
@PracticalProgramming Жыл бұрын
I appreciate that!
@jbzeus6100
@jbzeus6100 3 жыл бұрын
Coins are a great idea and all but I would preferably make the distance travelled the score and when a certain distance us reached the speed would increase. Could you make a video on this? Or if your too busy for it could your recommend a video that explains it? I would greatly appreciate it 😁
@mapleaf816
@mapleaf816 2 жыл бұрын
Is there a way to make it so you spawn one coin then on pickup(via player collision) it destroys the coin and respawns a new one ahead of the player?
@lydiarodriguez9686
@lydiarodriguez9686 3 жыл бұрын
What an amazing video, these tutorials have been very helpful! Is there a way to control the distance and quantity between the coins??
@PracticalProgramming
@PracticalProgramming 3 жыл бұрын
Thank you!! If you mean in the z (forward) direction, you would have to iterate over each z value that you want to spawn a coin in and combine it with a random X value to get its position. If you can't figure it out, when my exams are over and I get back into making videos that's a feature I might add :)
@muhammadmaisambinkhaqan2208
@muhammadmaisambinkhaqan2208 2 жыл бұрын
What do I have to do if I want to add a finish line at the end of the ground? Any help would be appreciated.
@VRDevStory
@VRDevStory 3 жыл бұрын
Thanks
@PracticalProgramming
@PracticalProgramming 3 жыл бұрын
You're welcome :)
@mehmetkaancakir
@mehmetkaancakir 9 ай бұрын
Hello, we have set the acceleration as we collect the gold, can we give an upper limit to this? I would appreciate your help.
@samuelwilliams8453
@samuelwilliams8453 3 жыл бұрын
I'm following this tutorial at the moment! It's great! Thank you so much. I want to know...how do I change my player from a bean to being an character asset I have and how can I change the obstacles, so that different obstacle assets load randomly, rather than the same block?
@PracticalProgramming
@PracticalProgramming 3 жыл бұрын
Hi Samuel - thanks for the positive feedback! To change your character model, select the Player in the hierarchy, and in the Inspector you will see a component called "Mesh Filter", which is currently set to Capsule. If you click on the target icon (to the right of "Capsule"), it will bring up a screen where you can select any model that you want for your player. As for the obstacles, I go over creating different types of obstacles and spawning them randomly in the last video of this series, so I hope that helps you. If you have any more questions, feel free to ask and I'll do my best to help :) (P.S. School is starting up again where I am, so I might take a while to reply)
@samuelwilliams8453
@samuelwilliams8453 3 жыл бұрын
@@PracticalProgramming thank you so much! This is really helpful!
@user-kj7cw4bx6z
@user-kj7cw4bx6z 3 жыл бұрын
I made a switch () with different kinds of obstacles and then randomly set them to spawn
@mohsinalikhan2941
@mohsinalikhan2941 2 жыл бұрын
Hi . This tutorial helped me a lot in my endless car driving game.i have spawned limited number of coins in the road and when all the coins destroyed I recalled the method spawn coins but coins are not spawning once destroyed, the method is being called but nothing happening ...plz help me sort out the problem.
@DiegoPaulo2023
@DiegoPaulo2023 3 жыл бұрын
How do you stop coins from spawning into one another
@Dubble312
@Dubble312 2 жыл бұрын
Love the tutorials. But when I apply the Kinematic Rigidbody to the coins, none spawn. Any idea why?
@PracticalProgramming
@PracticalProgramming 2 жыл бұрын
There's a link to GitHub in the description where you can download the project. Try comparing your scripts to mine and see if there are any differences, and check the prefabs are all the same as well. Sorry, but I don't know what the problem is just from that. I hope this helps though :)
@malithmadhawa4714
@malithmadhawa4714 Жыл бұрын
Hi, your tutorials are amazing but my coin score is not increasing after I collect coins. Can you help me with that ??
@livers540
@livers540 5 ай бұрын
I need help folks, when I turn on the "is trigger" on, I can't seem to pick up the coin.
@duobot7355
@duobot7355 Жыл бұрын
Thanks for the lessons! but at least i cant drag and drop my ScoreText in the Field from GameManager. Any tips here ?
@duobot7355
@duobot7355 Жыл бұрын
okay i found it by my self :D
@VoidAeren
@VoidAeren Жыл бұрын
@@duobot7355 Hey, can you share your solution? I’m having the same issue
@SashKalash.
@SashKalash. 9 ай бұрын
how @@duobot7355
@SashKalash.
@SashKalash. 9 ай бұрын
please tell me how
@AveryCruz-se5ky
@AveryCruz-se5ky Ай бұрын
can you at least tell us how?
@thousend6693
@thousend6693 2 жыл бұрын
Wenn my Player hits an abstacle nothing happens but when he falls of the ground the game gets restarted can someone help me? (I have no errors)
@NOTLM10_
@NOTLM10_ Ай бұрын
brother (21:50) i cant add the score text to the ScoreText variable in GameManager
@niravpatel8542
@niravpatel8542 22 күн бұрын
Hello, you would be adding TextMeshPro, however, to fix this issue you can scroll down to “Legacy” and from there you can select the TEXT and your issue will be fixed.
@julianiano
@julianiano 2 жыл бұрын
can someone explain me please what "this" mean?
@dayshag5257
@dayshag5257 2 жыл бұрын
My spawns behind me how do i fix it?
@Cocomacsonian
@Cocomacsonian 2 жыл бұрын
How can i make less coins spawn
@dumbguy1073
@dumbguy1073 3 жыл бұрын
idk why but my player is not moving when the game strts and sometimes the player will be inn air and spawing will be not there plz help me
@PracticalProgramming
@PracticalProgramming 3 жыл бұрын
I have put the project on GitHub and there should be a link to download it in the description of the video. If you download that you can compare the scripts and see what went wrong - Likely just a missed line of code or something like that :) If you are still having trouble with it after that, if you elaborate on your problem I can try to help.
@mouthbreather1387
@mouthbreather1387 3 жыл бұрын
Anyone know why my lighting gets destroyed when I run into an obstacle and the game restarts?
@vargasxr421
@vargasxr421 2 жыл бұрын
yes go to Window>Rendering>Light Settings and click on Auto Generate at the bottom of the panel it will Render lighting
@dattoproduction4450
@dattoproduction4450 3 жыл бұрын
I have a problem. The coin doesnt destroy
@martinovlog
@martinovlog 3 жыл бұрын
Have you solved it?
@ayonimimartin874
@ayonimimartin874 3 жыл бұрын
yo sk copied your code over to my project and the same thing keep happening the tile after a few seconds of playing disappears infront of my player
@PracticalProgramming
@PracticalProgramming 3 жыл бұрын
I'm going to be busy with exams for the next month to 2 months, but once they're over I'll try to solve it. Sorry for the delay, but exams are a priority for me right now. Hopefully it will still be helpful :)
@Foolishmanonhill
@Foolishmanonhill 3 жыл бұрын
@@PracticalProgramming I'm having the same problem, it seems as though it will destroy random tiles at random times, no matter if it is in front or behind the player. It didn't start happening until this tutorial section. I have noticed (since I finished part 5 f the tutorial already) that it only starts happening when coins are collected, so it must be in relation to that but I cannot figure out why??? Any help would be greatly appreciated!
@Namsonic1
@Namsonic1 2 жыл бұрын
@@Foolishmanonhill I've just had the same issue. Only the ground tiles that you have passed should be destroyed but I think that when the coins are being spawned on a ground tile ahead of you, if the coin was spawned within an obstacle then the coin is destroyed which might be triggering the OnTriggerExit of the GroundTile script. If someone could confirm my logic here that would be appreciated as I'm new to game dev and Unity. I added a player check to this function and it solved the issue for me, see code below and let me know if this works (I've used gameObject.tag because gameObject.name was not working for me for some reason): private void OnTriggerExit (Collider other) { if (other.gameObject.tag == "Player") { groundSpawner.SpawnTile(true); Destroy(gameObject, 5); } }
@cagataygenc0304
@cagataygenc0304 2 жыл бұрын
Hi guys I'm having the same issue and all of these started to happen after applying Rigidbody to Coins. Not sure how to solve thou
@ramandhillon1
@ramandhillon1 3 жыл бұрын
I am not able to collect the coins. Player is passing through the coins. What I can do ??
@PracticalProgramming
@PracticalProgramming 3 жыл бұрын
Go to GitHub (first link in the description) and check my code against yours. If you still can't find the issue, try rewatching the video to make sure you haven't missed anything (such as not adding a collider component). If that still doesn't work let me know and I'll see how I can help.
@essa3236
@essa3236 2 жыл бұрын
did you fix this?
@miauwderman2974
@miauwderman2974 10 ай бұрын
2 years late. You need to add Collider to your player object
@Reham9000
@Reham9000 2 жыл бұрын
13:35 What happend??
@Harry2
@Harry2 3 жыл бұрын
why would you ever define a public variable half way down your script? That is going to make the code impossibly hard to manage as it grows, with random public variables hidden among the functions who knows how far down from the top. If you're going to make tutorials you should make sure to follow good coding practice. When you're checking for the coin spawning inside an obstacle you should just tag all the obstacles 'Obstacle' and check that rather than doing GetComponent, as thats very expensive.
@PracticalProgramming
@PracticalProgramming 3 жыл бұрын
This is meant to be for complete beginners, so I grouped things (variables and methods) together by what they are meant to do. I am going to fix that all in the final video where I would show the people best practices when coding, and explain why we do things in certain ways. Thank you for the feedback though, next time I'll definitely just do it correctly from the start :)
@yogangstudios5715
@yogangstudios5715 3 жыл бұрын
Imagine understanding programming
3D ENDLESS RUNNER IN UNITY - OBSTACLES (Pt 3)
14:59
Practical Programming
Рет қаралды 47 М.
Heartwarming: Stranger Saves Puppy from Hot Car #shorts
00:22
Fabiosa Best Lifehacks
Рет қаралды 21 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
00:56
صدام العزي
Рет қаралды 42 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 20 МЛН
3D ENDLESS RUNNER IN UNITY - PLAYER (Pt 1)
15:55
Practical Programming
Рет қаралды 91 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 637 М.
Why has Black & White Been Abandoned? - Noclip Greatest Hits
28:44
Noclip - Video Game Documentaries
Рет қаралды 663 М.
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 515 М.
3D ENDLESS RUNNER IN UNITY - ENDLESS GROUND SPAWNING (Pt 2)
13:07
Practical Programming
Рет қаралды 65 М.
How To Make UIs without frustration | Unity Beginner Tutorial
16:58
This is GameDev
Рет қаралды 29 М.
Unity Tutorial - Simple Character Selection System
5:30
RumpledCode
Рет қаралды 84 М.
Procedural Generation: Endless Runner Unity Tutorial (Updated 2023)
9:28
Rigor Mortis Tortoise
Рет қаралды 19 М.