3D Endless Runner for Mobile in Unity: #02 - Spawning Roads - Unity Tutorial / Guide, Indie Devlog

preview_player
Показать описание
We create a simple and easy mobile endless runner in Unity 3D which we will later on release on the Google Play Store. And we will do it in a quick and dirty fashion. Follow me step-by-step through the process in this guide/tutorial.

In this episode we will make the road to behave like in an endless runner using c# scripts and spawn triggers. Rather than to instantiate new roads everytime when a player enters a trigger, we just move the roads behind him to the front. The code is quick and easy.

Follow me though step by step and create your very own version of the endless runner.

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

NullReferenceException: Object reference not set to an instance of an object
(UnityEngine.Collider other) (at my error

Suter.
Автор

one of the best spawning codes there is truly optimize and easy to handle tnx

abolfazlraoufi
Автор

THanks Bro but Roads spwan on my head ??? Or ROADS HAVE GAPPES

UchihaSgEditz
Автор

please help, i get this error : 'List<GameObject>' does not contain a definition for 'OrderBy' and no accessible extension method 'OrderBy' accepting a first argument of type 'List<GameObject>' could be found (are you missing a using directive or an assembly reference?)

Mattomo
Автор

Hello, could you help me?
I have two errors in Unity
1) Assets \ Scripts \ RoadSpawner.cs (15, 27): error CS1061: 'List <GameObject>' does not contain a definition for 'OrderBy' and no accessible extension method 'OrderBy' accepting a first argument of type 'List < GameObject> 'could be found (are you missing a using directive or an assembly reference?
2) Assets \ Scripts \ SpawnManager.cs (23, 21): error CS1061: 'RoadSpawner' does not contain a definition for 'MoveRoad' and no accessible extension method 'MoveRoad' accepting a first argument of type 'RoadSpawner' could be found (are you missing a using directive or an assembly reference?)
Thanks in advance!
PS You have very good video lessons: D

ryan-zwiv
Автор

Thank you for this video.
I discovered that I was having some weird issues with inconsistent road spawning, turns out that because my player model was made up of multiple bodies, the roadSpawn script was running for each. I have now tested it using just a sphere, and it works perfectly.
Hopefully this helps someone.

bananaramaman
Автор

Thanks brother, i been facing this problem all day😸

hiimtatsugo
Автор

Thanks for the tutorial mate really appreciate it:)

alimansoor
Автор

error CS1061: 'SpawnManager' does not contain a definition for 'SpawnTriggerEntered' and no accessible extension method 'SpawnTriggerEntered' accepting a first argument of type 'SpawnManager' could be found (are you missing a using directive or an assembly reference?)

pls help me :(

marsmyer
Автор

For me the road isn't spawning at all, for some reason only the streetlights respond but not the roads.
Help.

lindseytong
Автор

The spawner manager skript did not worked by me

TRIHCIBEKIR
Автор

Great tutorial and thank's for sharing. I run into problem's with moving the road. Trigger moves 3 part's of the road's and my car falls to it's doom :( ...please help. I added "Pas Mater" code and there is no difference...heelp please

anz
Автор

How do I do the reverse process as he said at the end, like, when you move forward it will spawn forward, just like in the video, but when you move backwards it will spawn backwards, like this:

Prefab 1. Player. Prefab 3

Obs: It's for a 3D game, like this one
I hope I managed to explain it right, can anyone help me?

officialfreemusic
Автор

Yay! Thanks for the great tutorial!!! Just finished #02. Only problem I had was adding Rigidbody around at 12:27. When I add this component and play, player just drop down thru the road. But when I check on "Is Kinematic" player stays on road. I am using some free prefab grass road. I don't know if this was the reason for that... Besides this, everything works GREAT! I just want to make sure, if this is going to be a problem later.

eunhan
Автор

Thanks for the tutorial mate. But my roads don't seem to spawn at all. The code seems fine without any error. Would u know why that might be?

govindck
Автор

Wow that fantastic man thx for tutorial

donuteam
Автор

why did it said
Assets\Scripts\RoadSpawner.cs(15, 27): error CS1061: 'List<GameObject>' does not contain a definition for 'OrderBy' and no accessible extension method 'OrderBy' accepting a first argument of type 'List<GameObject>' could be found (are you missing a using directive or an assembly reference?) PLS HELPP SIR IM URGENTT

harishfakhriy
Автор

What happens when the transform travel too far ? You know unity will start causing trouble when you get too far on Z-axis right?

oyokuva
Автор

Sir, how to fix problem with "OrderBy". in Vs code t says State
does not contain a definition for 'OrderBy' and no accessible extension method 'OrderBy' accepting a first argument of type could be found (are you missing a using directive or an assembly License\My project It would be great if you help me with this

ryandav
Автор

nice video sir.
i have just one problem i am able to to spawn the street lights but the road is not able to spawn.I am getting void space after the predefined road length.
Please help sir.

vigneshiyer