Amazing work buddy. have been at this for days but couldn`t figure out a way to do this script. Thanks a lot. :)
@phucle-tw4xd3 жыл бұрын
Thank you very much, you guide is very dedicated and thoughtful, I have never learned solidarity thanks to you but also understand a lot, wish you always good luck and peace during the covid 19 pandemic. Thank you for spreading this knowledge to the community.
@Kristiancimo4 жыл бұрын
Finally! I needed a way to remove the platforms after passing on them and you explained it very very well.
@GDTitans4 жыл бұрын
Thank you so much for your encouragement.
@Kristiancimo4 жыл бұрын
Developer3.5Pro is there a way to contact you? I added other functions so I can spawn walls and roof but I think I have a problem in zSpawn variable
@Kristiancimo4 жыл бұрын
Developer3.5Pro the problem is that even if the prefabs are exactly 40 units in z, if I set zSpawn += 40 the prefabs over collide
@jaehoopark81064 жыл бұрын
So good! Easy to follow and clean code! I'm looking forward seeing another Tutorials - TPS, FPs...
@GDTitans4 жыл бұрын
Thanks, I am waiting for the unity 2020 full version to work with it in my new series.
@gamingkayoddha Жыл бұрын
Dude really thank you I've been having this issue from past 3 weeks but your video solved it thank you so much 😊😊
@ArtyMartyD3 жыл бұрын
Christ those transitions are extra.
@IMXERone3 жыл бұрын
They go hard
@zeeshanhaider963610 ай бұрын
I copy every step but still tile are not spawning
@GamesOfVaibhav3 жыл бұрын
Simple And Streight Forward :)
@MinchanGaming2020 Жыл бұрын
Strangely found u here
@luqmaannana29084 жыл бұрын
Thanks. This is exactly what I needed
@promiseorazulike35684 жыл бұрын
Thanks bro..for optimization purpose can you make the tiles to be pooled from Objects Pooler. Thanks in advance
@TheJakeblake3 жыл бұрын
9:00 is the spot for infinity spawning
@rghvmttl4 жыл бұрын
Woww... such a great tutorial. I was searching for this from very a long time. Thank you!
@DidYouCropThat2 жыл бұрын
The good approach is to move the entire scene and not the player, especially for infinite runs. What happens when you reach a too far-away position in numbers? Also despawning behind the player is easier, as they won't notice it.
@cimaaaaaaa Жыл бұрын
Just what I needed, thanks mate
@GDTitans Жыл бұрын
Glad I could help
@animaster61772 жыл бұрын
For those who have gaps between tiles (ex. 1and 2 tiles -ok, 3 no), rebuild your tiles and PAY ATATTION to tiles x,y,z position. It's should be 0.0.0. It's better to move player capsule than road asset position or Tiles positions.
@martimalmeida172 жыл бұрын
thanks bro
@piyush5764 Жыл бұрын
can you please elaborate more to fix this
@zyxwars80354 жыл бұрын
Thank you, for the tutorial, really helpful and understandable.
@nishantkumar-up3ft4 жыл бұрын
Dude your video series on this runner game is very good 👍☺️🙂 but please make a video on character selector like you did on this game
@OmarWarda-g4z Жыл бұрын
The player after moving with normal speed for a specific period of time the speed decreases again automatically what could be the problem?
@t-mo_0723 Жыл бұрын
for some reason my player is not exactly in the middle of the path. it's slightly shifted to the left. how do i fixed it? great videos
@salamyousif46802 жыл бұрын
Thank you very much for the fantastic work you provided and I appreciate it so much I wish you a great success
@kvbialka2 жыл бұрын
hi, could you help me bc i've a problem " 'List' does not a definition for 'removeAt' and no accessible extension method 'removeAt' accepting a first argument of type 'List' could be found " Thanks
@keremhunsoy18484 жыл бұрын
Great job! Thanks.
@pixellegolas2 жыл бұрын
Is it possible to instantiate some small obejcts on the tiles to make them unique each time also?
@forsen21192 жыл бұрын
Hello. Thanks for the lesson! Please help me implement the level change. That is, when the player reaches a certain number of meters, the tile changes to another tile. I wrote code based on your lesson and I don't know how to implement it all.
@DukeFishron-mq1ir Жыл бұрын
Yea I would want that to but he never replied 😢😢😢
@forsen2119 Жыл бұрын
@@DukeFishron-mq1ir I don't think he will answer. I hope you found what you were looking for ;)
@DukeFishron-mq1ir Жыл бұрын
@@forsen2119 I never did but hey I am leaves unity for a reason but search it up 0.20$
@flayxxfn3 жыл бұрын
Thank you so much! This Tutorial was very helpfull for my game.
@GDTitans3 жыл бұрын
Thanks
@jadenhucke12314 жыл бұрын
PLEASE HELP! I'm having a few issues. 1.) Obstacles in the left and right lanes don't stop the player, despite having the same box collider as the same object in the middle lane. The player glides through the objects as if they don't exist. 2.) Objects in the middle lane which DO have a working box collider also stop the player in the left and right lanes, as if the box collider blocks all lanes. Jumping over this invisible barrier works, but I need the box colliders to affect its respective lane ONLY, NOT reach out into the surrounding lanes. I've searched EVERYWHERE for answers.
@GDTitans4 жыл бұрын
Watch part 8 I've talked about this issue.
@jadenhucke12314 жыл бұрын
@@GDTitans I just watched it, that issue is resolved thank you! Please refer to my newest comment on part 8. My game over screen activates instantly despite the floor tile not being tagged as an obstacle
@kubki58233 жыл бұрын
how i change it to x and y position?
@geldregen2 жыл бұрын
i need that too
@1onGoogle11 ай бұрын
Your code is not generating tiles prfectly, meaning that it creates only in one place... You could modify it by taking the first one as initial then other at the back
@yourkodi39454 жыл бұрын
hi friend, great guide. I think you will get better result moving the world (toward player) instead of the player (moving upwards), Great tutorial tho and keep up the great work
@Joemaniac712893 жыл бұрын
What do you mean?!
@yourkodi39453 жыл бұрын
@@Joemaniac71289 the world should move and recycle rather than the player constantly moving
@marhakass50114 жыл бұрын
brother so great i like ! i have a question about make some levels how can we do it ? thank you for help
@broodjekaas68054 жыл бұрын
Make new scenes. Then you will need a scene manager. and you will need to be able to trigger those scenes (Like on trigger entry) This is my help forum post. BUT all the code you need is in it and all the steps are basically there (This is for loading a new scene) forum.unity.com/threads/loading-new-scene-error-need-index.978477/#post-6356253 SCRIPT: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class NameOfScript: MonoBehaviour { public const string s_Level001 = "SceneName"; private void OnTriggerEnter(Collider other) { SceneManager.LoadScene("SceneName"); } } You need help? message me "Jo I need help with scenes" on discord! Wizard#3081
@technocraftSTUDIO4 жыл бұрын
one more step needed. what if i want to generate the first starting tile only appear once and not get repeated over time.
@19Grzib203 жыл бұрын
@DynamoXD Thanks!
@modnashri Жыл бұрын
@@Thediamondgames254 thanks you helped me
@just_caramel9 ай бұрын
hello i am confused my model is getting stuck on the x axis and my road is spawning at 6x for some reason is there a way to change where the road spawns on the x axis because my model wont move sorry
@The_Plorp2 жыл бұрын
how can I make some platforms be more rare than others?
@fatihcetiner6913 жыл бұрын
I live in turkey ,very nice thanks bro :)
@GDTitans3 жыл бұрын
Hi, thanks Fatih You are welcome
@danthonyhill99064 жыл бұрын
Hey are you going to be do speed multiplayer where speed increases ?
@YazlmAkademisieed Жыл бұрын
Easy and clean. Thank you.
@GDTitans Жыл бұрын
Thanks man
@kristiyanaleksiev84032 жыл бұрын
Thank you my bro
@GDTitans2 жыл бұрын
Any time
@ozgurgurbuz2 жыл бұрын
This is an awesome video. It work exactly as it told. But I have a problem. I don't want to spawn the same tile over and over again. I tried to change the codes but it didn't work. This is not working for example: "SpawnTile(Random.Range(0, tilePrefabs.Length - activeTiles[0]));" Please I want to learn how to make that.
@Adrian56555 Жыл бұрын
Hey thanks you are the best super Video, Super English👍👍
@ctwlprashant6134 жыл бұрын
@Developer3.5pro how is “Random” ambiguous reference between ‘unityEngine.random’ and ‘System. Random’ ?
@Keerthan_reddy2 жыл бұрын
could u help me my tiles are spawning in not in length
@syympl2573 жыл бұрын
i have an error where my player get stuck on the path while moving forward even though theres no obstacle infront of it and i have to jump in order for to make my player move again (it happens right next to a traffic cone [meaning it get stuck right next to a traffic cone ] until i jump and make it move ) please provide solution
@xxyxxyyyx4 жыл бұрын
even tho i have colliders on other tileprefabs then the first one, the player moves into them, my player only stops at the first obstacle at my first tileprefar, on the other tiles the obstacle dont work, but they have box colliders?
@GDTitans4 жыл бұрын
I've talked about this issue in part 8 Hope that helps
@mnkeycon76142 жыл бұрын
i have a question about how can loop my surrounding like buildings and all
@GDTitans2 жыл бұрын
Add the building to the tile prefabs
@abdidesign32553 жыл бұрын
Thanks a lot I have been looking for this type of tutorial for ages. But I have one issue. once all the prefabs are appear on the scene it somehow stops generating more tiles. I literally followed exactly what you did. Thanks
@JitsDebnath-mp1ns Жыл бұрын
hey can you make a tutorial on how to generate curved roads , like roads left and right so that my character can turn left and right and go ahead, similar to something in temple run? if you make it , it will be very very helpful for me , thanks in advance.
@GDTitans Жыл бұрын
Yeah sure!
@JitsDebnath-mp1ns Жыл бұрын
@@GDTitansplz man do it , It will be very useful for me
@shambles67944 жыл бұрын
How to make tiles spawn in a specific order? Like, spawn tiles 2,3,4,5 in order... Thank you. And nice tutorial series BTW.
@GDTitans4 жыл бұрын
Instead of using a random tile index. You can use a simple counter of type int. Each time you spawn a tile, you need to increment it by one. But, if the counter go above the total number of tiles you need to reset it to 0 and so on.
@shambles67944 жыл бұрын
@@GDTitans thank you. Looking forward to your other tutorials. Really helpful.
@AkashKonda-b7d11 ай бұрын
instantiating an object everytime we need them is bad approach, use object pooling its effective performance wise.
@DontKnow-wm6jn Жыл бұрын
how do i change the x position of the roads if i wish to?
@FoxxRyan77132 жыл бұрын
thank you sensei.
@GDTitans2 жыл бұрын
ありがとうございます。
@ixpleew Жыл бұрын
Thanks bro!
@GDTitans Жыл бұрын
Any time
@tomxle62784 жыл бұрын
I did it like you but in my code / game the streets don't destroy themselves although I have programmed "DeleteTile()" like you. The for loop is also like yours. Do you maybe know another solution
@GDTitans4 жыл бұрын
You can create a script and attach it to all of your tiles. Inside this script under the start method use Destroy(gameobject, 5) so that the tile gets destroyed after 5 seconds.
@tomxle62784 жыл бұрын
@@GDTitans I do not understand to which Tiles I have to attach it. Couldn`t I do an endless for loop where 4 tiles spawn and after they've spawned they get deleted ? Could you pleasse code that for me here in the comments it would be very kind of you :)
@GDTitans4 жыл бұрын
@@tomxle6278 Try to watch the video again to understand it. If not Can you send me a link for your project to check it out?
@juancarlosgarciachamorro11993 жыл бұрын
Hello, I have a problem, the obstacles are not generated infinitely, what can I do? (sorry if it's misspelled, I speak Spanish and I'm using google translator)
@shambles67943 жыл бұрын
I'm trying to add another set of prefab to the game. Like, spawn 20 tiles from first set then spawn 10 tiles from second prefab set and go back to first prefab set in a loop. I've been trying for days but I'm not getting it to work. How can i do that, please?😭😭
@robertnicu4 жыл бұрын
hey nice vid but i got a problem: for some reason, Unity refuses to belive that "zSpawn" is a variable and says its "an unexpected symbol" any help plz?
@technocraftSTUDIO4 жыл бұрын
if anyone know this step please share here or any link, i want to spawn the starting tile only once(no repeat) and then randomly generate the other tiles as well
@OMGamingNL3 жыл бұрын
Well, you probably don't need it anymore, but you can accomplish that simply by creating a boolean set on false, then where the first tile gets created put an if-statement asking if the bool is false, then create the starting platform and set the bool to true. then, after the ifstatement put an else-statement with the normal tile creating code. This way the code scans foor the bool only once because you never reset it and basically always does the 'else' (normal tile creation) instead of the 'if' (starting tile creation).
@tiny_GLOBE_cooks2 жыл бұрын
Please find a solution for left and right spawn position for track ie, -x and +x
@rifasmohamedniyasudeen52273 жыл бұрын
hey im only looking to implement this with a a side scroller shoot em up, but how can I implement this with both side spawning and removing them to free space?
@IamBlue.3 жыл бұрын
how often did you sayed ... "And go back into Unity" in this project? XD Just wondering
@kingsstudio47763 жыл бұрын
hey , i dont want to move player , i want tiles move towards player and delete when cross the player , and generate tiles infinite....?
@shivamchoudhary79264 жыл бұрын
awesome and great video
@jaeemalven79512 жыл бұрын
my player doesn't stop in the middle. i wonder why. can someone help me?
@GDTitans2 жыл бұрын
I have talked about this in the next part kzbin.info/www/bejne/eaXbfnRrmJ2Eirc
@alexis61553 жыл бұрын
i got this error Assets\scrips\TileManger.cs(29,51): error CS1061: 'GameObject[]' does not contain a definition for 'Lenght' and no accessible extension method 'Lenght' accepting a first argument of type 'GameObject[]' could be found (are you missing a using directive or an assembly reference?)
@szaaarlej3 жыл бұрын
U have a typo in the code, its length not lenght
@alexis61553 жыл бұрын
@@szaaarlej thanks, now I see that I have dislexia :D
@mehmetylmaz-mh6cs Жыл бұрын
Hi, i am getting error "UnassignedReferenceException: The variable playerTransform of TileManager has not been assigned. You probably need to assign the playerTransform variable of the TileManager script in the inspector." I am getting this error even though I copied the code from github, how can I fix it. @GDTitans
@QuickVidStudio4 жыл бұрын
Hey! I hope you are still active on your YT account. Everything is good since 6:50 but after this i cant enter gamemode and have error : GameObject does not contain for Lenght and no accessible extesnsion method Lenght accepting a first argument of type GameObject could be found... Hope for a quick respone :)
@advikkabra80394 жыл бұрын
Did you instantiate tilePrefabs as an array(put the square brackets after GameObject while instantiating)?
@systemofadown3244 жыл бұрын
tyr length instead of lenght
@beastcraft73874 жыл бұрын
You misspeled length instead U wrote lenght.
@alexg17654 жыл бұрын
How can I generate tiles next to each other? For example i want to spawn three tiles at x = -1, 0 and 1 and make them generate all together along the z axis. Thanks in advance
@pressf2play5264 жыл бұрын
Thanks!
@aqsaarif1243 жыл бұрын
how to find tile length of our gameobject like you set 30 ?
@aryanpeeple2 жыл бұрын
Bro how you learnt unity scripting
@ralex3053 жыл бұрын
can someone help me my whole delete tiles script is wrong i think its because active tiles , did you use them in other videos or just this one
@JoaoVitor-wg7xk3 жыл бұрын
alguém mais esta tendo erro com o código ? public void SpawnTile(int tileIndex) { Instantiate(tilePrefabs[tileIndex]), transform.forward * zSpawn, transform.rotation); zSpawn += tileLength; } ele da o erro que não e possível encontrar a variável, alguém poderia me ajudar por favor...
@ArunKumar-uh4mu4 жыл бұрын
mine left right movement is not working
@thegreatrc93023 жыл бұрын
Love your channel, the tiles seem to have a gap between them and you I can seem while moving forward , I tried adjusting the tile length but that only makes the tiles moves closer to each other and doesn't eliminate the gap. Is there a way to fix this in the code? thanks!
@GDTitans3 жыл бұрын
Make sure to put the right tileLength
@animaster61772 жыл бұрын
Did you fix it?
@mqgazinuz_hd84863 жыл бұрын
PLS HELP it says "the variable tileprefabs of TileManager doesnt exist anymore." pls help me fix that
@gid1233 жыл бұрын
F we get same problem
@omerercan49233 жыл бұрын
what should we do if our speed is high
@KhattakVibess8045 ай бұрын
thanks for class
@amalbabu39763 жыл бұрын
Hi, I'm getting big space between two tiles.
@GDTitans3 жыл бұрын
Change the tileLength
@ivanbradic3 жыл бұрын
How do i remove all objects in my list when i die?
@arvinrohani32252 жыл бұрын
Give like to this man u might think he is not doing a lot but believe he does by helping people like me so if it was helpful give a like to him for support that's a less thing we can do
@GDTitans2 жыл бұрын
Thanks 😊
@ioanniskopadis53424 жыл бұрын
everytime a tile spawns my game insta lags. maybe the tile length is wrong . how can i find the true tile length?
@GDTitans4 жыл бұрын
The easiest way is to put one tile reset the transform then try to put another one next to it with the move tool, the z position is the length.
@oscarsanchez-gv1by3 жыл бұрын
hi ! How do you know how many units does your tile is ?
@animaster61772 жыл бұрын
Game mode crushs Unity after 6:50
@vamsiavula20933 жыл бұрын
the player starts off the origin whenever i start the game
@zeeshanhaider963610 ай бұрын
using System.Collections; using System.Collections.Generic; using UnityEngine; public class TileManager : MonoBehaviour { public GameObject[] tilePrefabs; public float zSpawn = 100; public float tileLength = 10; public int numberofTiles = 4; public Transform Player; void Start() { for (int i = 0; i < numberofTiles; i++) { if(i == 0) { SpawnTile(0); }else { SpawnTile(Random.Range(0, tilePrefabs.Length)); } } } private void Update() { if(transform.position.z > zSpawn - (numberofTiles * tileLength)) { SpawnTile(Random.Range(0, tilePrefabs.Length)); } } void SpawnTile(int tileIndex) { Instantiate(tilePrefabs[tileIndex], transform.forward * zSpawn, transform.rotation); zSpawn += tileLength; }
@advaith_314 жыл бұрын
how to make the prefabs???
@hi-s4 жыл бұрын
هتعمل كورس باللغة العربية امتى؟
@GDTitans4 жыл бұрын
ما زلت أفكر في ذلك. ربما قريبا.
@zizerZxZ4 жыл бұрын
Amin
@amitmaaa66138 ай бұрын
داداش دمت گرم
@imaginationlydisabled5094 жыл бұрын
tnx
@oneleaf525debnitya64 жыл бұрын
My tile doesn't even spawn. Can anyone Help
@GDTitans4 жыл бұрын
What's the problem.
@oneleaf525debnitya64 жыл бұрын
@@GDTitans my tiles doesn't spawn on my front but on coordinated 500 away but when I drag my prefabs to the scene it spawn right in front of me
@GDTitans4 жыл бұрын
@@oneleaf525debnitya6 make sure to reset the transform of the TileManager empty game object.
@oneleaf525debnitya64 жыл бұрын
@@GDTitans Thanks it helped but like yours i have only 1 tile and when the 1 st one spawn its okay but on the second one it shows a bump. This problem is not there anywhere but only in b/w those 2
@davidpraslicka79313 жыл бұрын
SI SEF
@vamsiavula20933 жыл бұрын
any one there
@zidan17293 жыл бұрын
I have a problem when I click play my character flies away and the camera continues how can i fix it
@Keerthan_reddy2 жыл бұрын
could u help me my tiles are spawning in not in length