Cloud Spawning System in Unity (Instantiate Random floating prefabs) | Game dev Tutorial

  Рет қаралды 16,389

Lost Relic Games

Lost Relic Games

4 жыл бұрын

In this game dev tutorial I show how to create a dynamic cloud generation system in unity, which spawns and instantiates random cloud prefabs from our library (with random scales, position and speed)
Make car games easy with this Car Game Unity Asset:
u3d.as/1HFX
Join the discord community
/ discord
Subscribe here for more cool tutes
bit.ly/2MpZ1ao
Support me on Patreon:
/ lostrelicgames
My game Blood And Mead on Steam:
www.bloodandmead.com/steam
Project Files from this video:
drive.google.com/file/d/11k5w...
#gamedev #unity3d #programming

Пікірлер: 54
@thewiredspider9660
@thewiredspider9660 3 жыл бұрын
I love this video! I put a bit of random color and opacity into mine to give it even more variance. The clouds make the game feel so much more alive. Thank you!
@MichelleMassaMCM
@MichelleMassaMCM Жыл бұрын
I was looking for hours for a tutorial like this. This helped me SO MUCH. Thank you!
@soundhunter4349
@soundhunter4349 3 жыл бұрын
Thank you very much! I have started my first project in Unity and this is the first thing I decided to do. I spent about 3 days watching this tutorial and learning every word used here to realize everything properly. Finally I did it! It was really interesting, I got to know about lots of things, you helped me a lot!
@games2play502
@games2play502 4 жыл бұрын
Great tutorial this is a much better way than my way so ill use your code for my game also i have just subscribed to your channel, keep up the good work:)
@elwin1283
@elwin1283 3 жыл бұрын
Thanks for the great tutorial!
@user-xs7kg8tz1x
@user-xs7kg8tz1x 21 күн бұрын
Really good video!!! During I am watching, I was thinking about how about add some random and then the video shown add random things into the functions!!! That makes a lot different and more interesting!!! Really Great!!!
@VedoHT
@VedoHT 3 жыл бұрын
Thanks for the tutorial, helped a Brazilian who wants to implement this market more and more here, thanks again.
@synchaoz
@synchaoz 3 жыл бұрын
This is great! I will find a way to use this as part of a gore effect, just you wait and see.
@mitchellmacpherson4052
@mitchellmacpherson4052 2 жыл бұрын
Dude, thank you so much. This helped alot!
@hydrahung7156
@hydrahung7156 4 жыл бұрын
I don't know why you only have this much sub. Your videos are awesome mate
@LostRelicGames
@LostRelicGames 4 жыл бұрын
Hey thanks! Hopefully the youtube algorithm will cut me some slack! :)
@fabian6739
@fabian6739 4 жыл бұрын
Great tutorial! Just one question, how would I make the generator spawn clouds in a group? I want the clouds to spawn inside of a clouds gameobject so its visible on my canvas.
@fahdali5330
@fahdali5330 4 жыл бұрын
Good job, keep post the good stuff.
@LostRelicGames
@LostRelicGames 4 жыл бұрын
Thank you man
@jaskarnjass8548
@jaskarnjass8548 4 жыл бұрын
Awesome, well explained.
@LostRelicGames
@LostRelicGames 4 жыл бұрын
Thanks JJ!
@MegaJHONDY
@MegaJHONDY 2 жыл бұрын
pretty awesome
@LostRelicGames
@LostRelicGames 4 жыл бұрын
I hope you enjoy this tutorial! I appreciate every single like and comment, It really helps to keep this channel going and spread the knowledge. Don't forget to swing by the discord if you want to chat! :) discord.gg/yeTuU53
@brunosoares6717
@brunosoares6717 3 жыл бұрын
for those who want to make the generator follow the player here is what I did: I attach the cloud generator to my Virtualcamera, but it can be anything that follows the player without flip, then I just chance the StartPos to update or fixedupdate instead of Start and it's done =)
@coreysonofander
@coreysonofander 3 жыл бұрын
3:05 "Ship it!" Ha ha ha!
@yvesgingras1475
@yvesgingras1475 2 жыл бұрын
Quick question: Would it not be better to make a particule system instead? And combining the different textures of cloud into one sprite? I dont want to bash or anything this is a leggit question, I wonder wich one would bring the bet result for the lowest performance cost
@Offline1988
@Offline1988 3 жыл бұрын
many many many thx!
@_Elvano
@_Elvano 2 жыл бұрын
Rather than putting another invoke in the function use InvokeRepeating heres a little example InvokeRepeating("SpawnCloud", 1f, spawninterval); ^ That is when it starts so it starts calling after 1 second then it repeats every spawn interval
@MistaWind
@MistaWind 4 жыл бұрын
Awesome tutorial! :D Have you ever tried to make a mini replica Castle Crashers games? Not a full game of course but, like a one map 2.5D scroller with attacking and up down left right movement?
@LostRelicGames
@LostRelicGames 4 жыл бұрын
hey thanks! I actually love the side scrolling brawler genre. I did some hobby things with it years ago, but i' love to revisit it!
@MistaWind
@MistaWind 4 жыл бұрын
@@LostRelicGames I'd love to learn from it! :D You should do courses on Udemy if you haven't already!
@MertAliBarlas
@MertAliBarlas 3 жыл бұрын
it's working but, when I attach this CloudGenerator prefab to my camera its disappearing and the positions of each cloud prefab is not relative to camera. How can we fix this ? Thanks.
@omaewa5073
@omaewa5073 3 жыл бұрын
Khal Drogo is teaching me how to make clouds in unity ;))))
@TwistdRabbit
@TwistdRabbit 3 жыл бұрын
Hey, having some issues with this one, from the minute i opened the project i have an error in unity "Assets\CloudGeneratorScript.cs(42,28): error CS0246: The type or namespace name 'CloudScript' could not be found (are you missing a using directive or an assembly reference?) This was replaced after i added the CloudScript file from the video with "Assets\CloudGeneratorScript.cs(42,43): error CS1061: 'CloudScript' does not contain a definition for 'StarFloating' and no accessible extension method 'StarFloating' accepting a first argument of type 'CloudScript' could be found (are you missing a using directive or an assembly reference?) Moving back to unity after entering the cloudscript.cs code i cant play the scene I assume i will enter the information to fix this error as the video continues but i have managed to get as far as deleting the extra 3 clouds and now cant copy the component, the option is greyed out. Any help would be great.
@verofero
@verofero 4 жыл бұрын
wow..very nice
@LostRelicGames
@LostRelicGames 4 жыл бұрын
Thanks Ahmed! Glad you like it.
@mohamedmusamustafa3324
@mohamedmusamustafa3324 3 жыл бұрын
I have a problem where if my camera goes into the right direction, the clouds stop appearing and if i go fast enough they wont be there.
@MertAliBarlas
@MertAliBarlas 3 жыл бұрын
same
@finfondler998
@finfondler998 2 жыл бұрын
Is it possible to create a randomly generating scene and have it running as a webpage? Very noobish question I'm sorry but I just had an idea from this video.
@fatmarajab114
@fatmarajab114 4 жыл бұрын
Really helpful tutorial... I have most of it working but I'm coming across 2 problems.. 1. My clouds are still all spawning on the same y value, even though I've tried varying the y displacement by about 100 2. When running the prewarm, all the spawned clouds are at the cloud generator point and not spawning across the scene I have a fairly large 2d scene which could be the cause of these issues, but I would really appreciate an expert opinion...
@jannahilario314
@jannahilario314 Жыл бұрын
Hii, can you help me? I'm getting this error in endPoint saying that it does not contain the definition for transform. What to do? 😢
@ChristianOrthodox
@ChristianOrthodox 3 жыл бұрын
thanks
@flyssa8211
@flyssa8211 4 жыл бұрын
Hello, can i use this to... say, make an asteroid belt on a topdown space shooter?
@LostRelicGames
@LostRelicGames 4 жыл бұрын
Absolutely, for top down you h would simply change the movement direction, should be one line of code. If you run into any issue swing by the discord and I'll help you out! :)
@Kingizeekiel
@Kingizeekiel 3 жыл бұрын
I have an issue where only 1 cloud will spawn ever, any help?
@jakobpriebe2393
@jakobpriebe2393 4 жыл бұрын
thanks bro
@LostRelicGames
@LostRelicGames 4 жыл бұрын
my pleasure man
@jackyb2837
@jackyb2837 3 жыл бұрын
i cant see the override button at all? any ideas? its at 3:18
@Thebaker3
@Thebaker3 3 жыл бұрын
Can i use this for a 3d game ?
@oliverj2635
@oliverj2635 2 жыл бұрын
I'm doing everything you say but it still doesn't work :( NullReferenceException: Object reference not set to an instance of an object CloudGeneratorScript.SpawnCloud (UnityEngine.Vector3 startPos) (at Assets/Scripts/CloudGeneratorScript.cs:41) CloudGeneratorScript.Prewarm () (at Assets/Scripts/CloudGeneratorScript.cs:59) CloudGeneratorScript.Start () (at Assets/Scripts/CloudGeneratorScript.cs:22)
@fabsze7857
@fabsze7857 2 жыл бұрын
hmm I'm facing the exact same problem
@kayaltamira
@kayaltamira Жыл бұрын
@@fabsze7857 heya... did you ever got this fixed? I started to do this now and I have the same problem. I did everything he said to the T and I even tried to fix this problem with .find code, changing the name of my script, then re-linking it and nothing. Is driving me mad. I've done the tutorial twice, getting the same Null results. Any help would be much appreciated x
@MistyWings
@MistyWings Жыл бұрын
Hey! Just wondering if anyone was having trouble with some of the prewarmed clouds not moving? It's not all of them, but it's very noticeable.
@model2k204
@model2k204 2 жыл бұрын
For some reason its not detecting my endpoint properly keep deleting it at a weird point
@StigDesign
@StigDesign 4 жыл бұрын
Great video as allways :D btw i can help you with Rune Text in that Viking game(Am from Norway so am a Viking hehe) :) Loved the 10/10 ign Refrence XD althoe its usually only COD that gets 10/10 ;D
@serim7414
@serim7414 2 жыл бұрын
Thank you very much I worked great, but as much as I try I can not make them born from a point as a child, for example as children cloud generator.
@serim7414
@serim7414 2 жыл бұрын
Fix it pretty quickly, but I'll leave it here if someone needs help. in SpawnCloud cloud.transform.parent = transform;
@kajaplayer1866
@kajaplayer1866 8 ай бұрын
thanks bro
This Famous Game Designer Had A BAD Steam Launch - My Thoughts.
10:03
Lost Relic Games
Рет қаралды 77 М.
System Driven Level Design (My Biggest Mistake)
7:15
Lost Relic Games
Рет қаралды 29 М.
Шокирующая Речь Выпускника 😳📽️@CarrolltonTexas
00:43
Глеб Рандалайнен
Рет қаралды 9 МЛН
La final estuvo difícil
00:34
Juan De Dios Pantoja
Рет қаралды 28 МЛН
WHY DOES SHE HAVE A REWARD? #youtubecreatorawards
00:41
Levsob
Рет қаралды 36 МЛН
Spawning Objects in Unity [Using Instantiate]
10:23
Press Start
Рет қаралды 238 М.
Coding Adventure: Clouds
12:50
Sebastian Lague
Рет қаралды 1,2 МЛН
Breaking up Code in Unity (Important game dev tips for beginners)
18:36
Lost Relic Games
Рет қаралды 123 М.
HOW TO Add RAIN To YOUR 2D GAME - UNITY
7:58
Lost Game Dev
Рет қаралды 13 М.
How much MONEY my Game made (and how much it cost!)
14:00
Code Monkey
Рет қаралды 152 М.
How to use Prefab Variants - Quick Unity Tutorials
2:30
toficofi
Рет қаралды 52 М.
Adaptive Enemy AI Patrol System - Complete Unity Game Dev Tutorial
27:19
Lost Relic Games
Рет қаралды 17 М.
The BlackthornProd GameDev Challenge Controversy - My Response
8:04
Lost Relic Games
Рет қаралды 63 М.