Hey there! Script used in the video is not perfect - I'd suggest to change constructor to get next block id (and modify all other methods to trigger story block from the array with a given id) instead of passing in StoryBlock object reference. I've just added a source code of this game with enhancements to my Patreon: www.patreon.com/cococode?s=gui It also comes with other useful features, like: - Story blocks editing in the inspector - More flexible system based on block id as an int value instead of class object reference Of course you'll get access to all my other video project files! Keep learning! 🎓
@yuyah7413
2 жыл бұрын
the code doesnt work
@ivohury3481
3 ай бұрын
Ok, and where is the code in Patreon? I have not found him...
@CocoCode
3 ай бұрын
@@ivohury3481 Hey! The source code is available for Patreon supporters, you can find it here: www.patreon.com/posts/46508536?s=yt
@myers4924
Жыл бұрын
Hey newcomers, if nothing is working, or if you can't drag the maintext into the slot in the camera. Make sure you use UI -> Legacy -> Text, instead of UI -> Text Mesh Mesh Pro
@abdulraufvahap2712
11 ай бұрын
hey! thanks for the comment i was really struggling thanks alot!!!
@pieceofcrab5685
7 ай бұрын
Hey, I'm having a problem with adding another text. I created a text serving as a main menu title and want to add another text but can't for some reason. "Can't add 'Text' to Canvas because a 'Text' is already added to the game object! A GameObject can only contain one 'Graphic' component." I'm really hoping someone could help me
@its_puzzled
3 ай бұрын
I like the way you talk in videos, its more easy to understand for non-english speakers.
@nellowz5451
3 жыл бұрын
"its getting a bit harder" is the perfect statement for a beginner like me.
@luisguilhermesilvarodrigue8242
3 жыл бұрын
This video is perfect. the icing on the cake was speeding the coding block with a relaxing music.
@CocoCode
3 жыл бұрын
Thank you very much! Be sure to check out other Unity tutorials on my channel 🌟
@JFroggo-Gaming
2 жыл бұрын
Such an amazing tutorial! Many many thanks! I am currently finishing my last year of computer game design and I find this tutorial very helpful for someone who has never used Unity before. I want to create my own text game with some multiplayer aspects but for the first part that's more than enough for me :-)
@qnpfr5656
2 жыл бұрын
This is the most helpful unity lecture that i've found!!! I'm studying unity on my own to make a game, but it's incredibly hard for me. Thank you so much!! 😆😆😆😆👍👍👍
@Drumsrose
Жыл бұрын
Thank you so much I’m a big text adventure enthusiast and this is very helpful to start working on my own ❤
@yuyah7413
2 жыл бұрын
Another error :( when i click any button, nothing happens and it gives an error NullReferenceException: Object reference not set to an instance of an object GameManager.DisplayBlock (StoryBlock block)... someone help me please
@thatguy_connlee
2 жыл бұрын
you still alive there bro?
@yuyah7413
2 жыл бұрын
@@thatguy_connlee yeah
@thatguy_connlee
2 жыл бұрын
@@yuyah7413 i thought i fixed it...i didn't 😭😭 this shit frustrating bro
@yuyah7413
2 жыл бұрын
@@thatguy_connlee I know what I fucked up, so basically, he put the numbers from highest to lowest, I put it lowest to highest, and thats where the bug is coming from
@ibnmianal-buna3176
2 жыл бұрын
@@yuyah7413 Wait what do you mean "he put the numbers from highest to lowest"? I got the same error.
@guilhermebighetti156
3 жыл бұрын
Thanks so much! I was going crazy trying to figure out how to make a text adventure and could not find any good tutorial until your video!
@CocoCode
3 жыл бұрын
Great to hear that. Good luck and be sure to check out my other videos ;)
@guilhermebighetti156
3 жыл бұрын
@@CocoCode I will! I have just one question, if my blocks list are not ordered like 9,8,6,.. the game won't work, and when I try to go back a block it does not work, I think I'm doing something wrong... (Just to be clear, i'm trying to create a loop, some decisions give you the options go back to a specific story moment, but every time i'm in block6 and try to take the story to block2 it give me: "NullReferenceException: Object reference not set to an instance of an object GameManager.DisplayBlock (StoryBlock Block) (at Assets/Game/Scripts/GameManager.cs:48)"
@CocoCode
3 жыл бұрын
Yeah... So the implementation in this video isn't the best. I'd suggest to change the script that instead of passing in the object of the different story block, you will pass in only the 'id number' (int value) that will tell which story block id should be loaded. In fact, I've just done that and uploaded an ENHANCED version of this game on my Patreon. It also comes with some other features like editing the story blocks in the editor 💬 Be welcomed to check it out: www.patreon.com/cococode?s=gui
@guilhermebighetti156
3 жыл бұрын
@@CocoCode Thanks! I would just like to know if the Supporter level in your Patreon give me access to this video?
@CocoCode
3 жыл бұрын
Yes it does! You can check the list of all available source codes in the Patreon description - I'm still working on adding new source code files - target all my videos ;)
@BadAtForHonor7213
2 жыл бұрын
for people having problems with block5 leading to block3, I have found that putting a duplicate block3 above block5 and renaming it in both blocks fixes it. static StoryBlock block8 = new StoryBlock static StoryBlock block7 = new StoryBlock static StoryBlock block6 = new StoryBlock static StoryBlock block3b = new StoryBlock static StoryBlock block5 = new StoryBlock(".....", "....", "....", "...", "block3b") static StoryBlock block4 = new StoryBlock static StoryBlock block3 = new StoryBlock static StoryBlock block2 = new StoryBlock static StoryBlock block1 = new StoryBlock The issue is that when block5 is read, it doesn't know block3 exists, because it hasn't come across it yet. This is why he writes the blocks counting backward as he goes down.
@princea08999
Жыл бұрын
thak you
@MrFarkasOfficial
3 жыл бұрын
Really cool! I got a little confused with the block system where you connect the blocks through script, but I’ll just rewatch that part until it clicks.
@CocoCode
3 жыл бұрын
Hah! Just a friendly reminder that on Patreon you can find reworked version of this project + source codes for many other videos!
@nftink3r411
2 жыл бұрын
I have a question if you could -- I realized that this coding does not allow multiple story blocks to be tied to the same instance (i.e. you can't have 2 story options both go to the same story block). Is there an easy way to fix this? Did you answer this question already?
@VLOneWay
3 жыл бұрын
really nice tutorial. I try to make a simple d&d based text rpg game. It would be nice if you could show how to smart manage items, character stats or how to create those easier and implement them. this would be great and nobody on youtube shows this properly or in easy words like you do.
@CocoCode
3 жыл бұрын
Noted! Be sure to subscribe if any videos about inventory etc. will show up!
@troisot1107
3 жыл бұрын
How to switch new background image to the particular text? Could you create more tutorials for this ?
@501_faraaz_tycs5
3 жыл бұрын
YOOOOOOOOOOOOOOOOOOOO you sound exactly like Artyom from Metro 2033
@ChoppedSpam
3 жыл бұрын
Hi there, Could you please explain the logic behind if i wanted to include only one or even three options in one of the story blocks. How would i have to change the code for this to work?
@random_precision_software
Ай бұрын
Can you do a video on using Xbox controller and selecting Bitton on UI
@924syn
Жыл бұрын
Hey, got a question. Is there a way to implement a 'image changing' after pressing one of the options? I'm planning to add a sprite like a head bobble that changes in expression depending on the choice or button you pressed.
@SPX900
Жыл бұрын
Yea absolutely. Just change the sprite’s source image with the button click event. There’s all sorts of tutorials on this if you still haven’t figured it out yet.
@mariadel4136
8 ай бұрын
Amazing video! Thank you for your help with my learning journey =)
@yuyah7413
2 жыл бұрын
I'm getting a null exception for the line of mainText.text = block.story;
@CringeMaster64
2 жыл бұрын
did you find a way to fix that?
@yuyah7413
2 жыл бұрын
@@CringeMaster64 yep
@djdoombot4612
2 жыл бұрын
@@yuyah7413 Care to explain? Stuck at the same spot.
@KenTay2
Жыл бұрын
anyone have the fix for the error
@yuyah7413
Жыл бұрын
@@KenTay2 put the blocks in descending order not in ascending order
@simei_alves
3 жыл бұрын
Hi ! Im using Visual Studio Community 2019 on Windows 10, why doesn't the Intelissense Suggestions appear ? Same with the colours in the text :/ Help me please :') Nice video btw !
@freddy2t
3 жыл бұрын
I'm having the same issue here. I did not get suggestions like 'getComponentInChildren' and it is not working
@simei_alves
3 жыл бұрын
Someone help us :')
@CocoCode
3 жыл бұрын
I’m not using Visual studio for Windows, but how about a quick google search? 😇 Good luck! forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/
@simei_alves
3 жыл бұрын
@@CocoCode Thank you! I had already seen that post before but I read it again and I had on the preferences the default one but It needs to be the one you are using (vscommunity in my case) it's working now, thank you a lot! Keep the good work!
@PONCINCATH
3 ай бұрын
Hi I have a question could you please help me to adapt the Game Manager cs for a version 2023 Unity - I have got problems Thanks a lot
@akmaludddin9281
6 ай бұрын
Good. Good! This is sooooo Gooood!
@vinegar5220
4 жыл бұрын
the kind of basic tutorial i needed :) thanks! im able to catch up with the pace wonderfully too although im a slow learner lol
@CocoCode
4 жыл бұрын
Glad it was helpful! I'm still in making more UI tutorials so be sure to subscribe for more ;)
@yuyah7413
2 жыл бұрын
why am i getting an error for NullReferenceException
@selinsinan6110
3 жыл бұрын
THAT'S AMAZINGGGG THANK YOU SO SO SO SO SO MUCHH!!!!!!
@adart00
11 ай бұрын
What do I need to do so that I can go back to the past block by clicking the button, in this code it gives an error
@awakenedsoulschannel
2 жыл бұрын
This was great and simple! Fantastic for beginners like me! Thank you.
@negi_404
Жыл бұрын
How to put a method of loading a scene in a StoryBlock instead of an ID block, for example?
@924syn
Жыл бұрын
I got CS1737 on the Class Constructor. I did everything and made sure there was no typos. How do i fix this?
@GOSIjnr
2 жыл бұрын
Nice tutorial, I have a question tho Which is better to use this method or scriptableobject?
@casualtea7973
2 жыл бұрын
i followed the tutorial but there are many problems with my code. i have 18 blocks but they created around 20 errors. i tried fixing them but somehow I just created more and more errors. i decided to "//" them all and work from one. i now only have 1 error and have no clue on how to fix it. it says "C0236 A field initializer cannot reference the non-static field, method, or property 'name'. Instance fields cannot be used to initialize other instance fields outside a method." please help
@ticketforlife2103
2 жыл бұрын
can you make a tutorial like this but with the interrogation of of Twine storyline system?
@yuyah7413
2 жыл бұрын
I'm getting an error CS1061: 'Text' does not contain a definition for 'Text'....
@CocoCode
2 жыл бұрын
Are you sure you're typing ".text" starting with a small letter. Example: TextVariable.text = "test";
@yuyah7413
2 жыл бұрын
@@CocoCode OM MY FREAKING GOD THANK YOU AND SORRY FOR WASTING YOUR TIME! IM SO DUMBBBBB SORRYYYYYY
@joellindley6861
2 жыл бұрын
^ NEWBIE. Unsure if you're still active on this thread. I have a question, I've looked everywhere for hours and I cannot find an answer and it seems like a very simple one. I'm using an open book in my multiple choice game, the main text currently spans one side (the left), I'm wondering if there is any piece of code I could add to the code you have provided in this video, to get anything that cannot be included in the left side text box (Let's say it's lengthy.) to appear in the right side text box instead of just clipping? and Additionally, any advice on let's say I want two options on one slide, and on the next, 3 choices?
@ChoppedSpam
3 жыл бұрын
Is there a way to make the main text either of the options from the previous block?
@twilkdamilk4659
8 ай бұрын
Does anyone know why my UI is never processed by the camerara?
@CocoCode
8 ай бұрын
Click on canvas element in hierarchy and experiment with Canvas “Render modes”
@twilkdamilk4659
8 ай бұрын
@@CocoCode It worked thanks
@negi_404
Жыл бұрын
Thank you
@tensikinho
3 жыл бұрын
hi, i did everything good and somehow i get an error :/
@Xjag
3 жыл бұрын
Where can i make my own like plan thingy on how im gonna make the game with story blocks
@CocoCode
3 жыл бұрын
Check out draw.io/
@300SonsofOdin
2 жыл бұрын
One Question, guys. Is there a way to import text files and display them instead of writing the text in the code itself?
@micropanda7916
2 жыл бұрын
U could write text file in specific format and then write some function that would convert it into storyblocks
@birolcoruh1702
4 жыл бұрын
(NullReferenceException: Object reference not set to an instance of an object ) unity gives this error for cs 48 and cs 54 . How can i solve this problem ?
@CocoCode
4 жыл бұрын
I’m pretty sure it’s something about StoryBlocks. Are you sure you defined them in the same order (8>1)
@birolcoruh1702
4 жыл бұрын
@@CocoCode slightly changed the contents but the ordering is exactly the same (8>1)
@CocoCode
4 жыл бұрын
Can you paste your code on pastebin and mark which lines does throw an error? Also, please make sure if you connected all script elements in Unity
@JXDfr
3 ай бұрын
Mystery ❌ Mistery ☑️☑️☑️☑️☑️☑️☑️☑️
@Heperoo
3 жыл бұрын
Have you thought about continuing this game?
@mastervanity3912
3 жыл бұрын
i love you
@CocoCode
3 жыл бұрын
Awww 🏝 Be sure to check out other tutorials on my channel ✨
@PONCINCATH
3 ай бұрын
Hi I have just pay to become supporter, could you please help me to adapt and actualize your first video Castle Mistery, Thanks a lot
@faxigamer
3 жыл бұрын
You are going way too fast. In the start, there is no explanation of any of the specific code verbs you are writing, and you don't explain what they actually do.
@CocoCode
3 жыл бұрын
This was one of the first videos on my channel, now I’m trying to take explain everything more clearly. Check out my other Unity UI videos! Also, maybe I’ll try to refresh this video one day to match the higher standards
@codedino
5 ай бұрын
we like your art too much.can you make a video about your art
@mrlima2953
3 жыл бұрын
Excellent tutorial, champ! Really helped me. Thanks again. You've just gained a new subscriber.
@thatonerealguy69
2 жыл бұрын
Long time ago, I tried to do that type of game by myself, using only "ifs" and "elses". I had very shitty code so i abandoned it...
@TheGameCouncilor
4 ай бұрын
Cant find text but see text mesh? click legacy instead of text mesh ( at the bottom for me) and in legacy you will see Text
@TheGameCouncilor
4 ай бұрын
Like if you also came to make your life sim / bitlife( instlife, altlife) type game
@ikizlerlebirgun7119
3 жыл бұрын
Amazing
@CocoCode
3 жыл бұрын
Thank you! Be sure to check out other Unity UI tutorials on this channel ;)
@ikizlerlebirgun7119
3 жыл бұрын
@@CocoCode Your channel haves a very high quality contents so i will surely check all them out!
@wave9nut
9 ай бұрын
WHY CAN'T IT GO BACKWARDS
@lee1davis1
Жыл бұрын
My first coding experience was with a commador 64 computer were Mt first game was text based. I still have the hard floppy I saved it on.
@924syn
Жыл бұрын
Which part of the storyblock needs the ' static ' ? Is it storyblock block1 = new storyblock static("text", "text", "text"); ?
@V.Z.69
3 жыл бұрын
Is creating a CANVAS the ONLY way to get text onto the Scene? I want the TEXT to be static. But I want to bring other objects onto the STAGE that will hover over the text. So, you say "canvas is always over 3D objects". I'd like my text to be on a layer that I choose. What do you suggest? I don't want buttons. They will be a text inside a box, the user will be able to click this box. But later an animation will cover this text and box.
@vapx0075
3 жыл бұрын
I saw this one the other day in class! It's about changing the canvas you want in the world to not be global and then resizing it and relocating it over the object. Under the Canvas component, try Render mode and turn it to "World Space". Then you probably make it part of the prefab and that should solve those couple of issues. I don't necessarily want buttons either, but have you tried making the buttons the same size of the canvas and then removing the image to make them invisible? Or have you tried another channel? This is the third video I've looked at trying to get a simple text adventure going. The last one I was watching used left and right arrows instead of buttons. This one: kzitem.info/news/bejne/mIakvpZuj2N_lJw This is the first one I've seen that allows you to pull your text from a GameText file which means you can review for spelling and Grammar. Or you know, turn all your text to German. This one also looks simple enough to be actually what I was looking for. That doesn't mean it's what 'you're' after. And your last sentence I can't help. Good luck! :)
@sanjit5358
4 жыл бұрын
Nice work with the explanation as well. Hoping to see more of your tutorials.
@CocoCode
4 жыл бұрын
Thanks!
@rockybalboa6514
3 жыл бұрын
Hey, nice tutorial. I'm new to unity. Does it make sense to connect the storyblocks to a database to get the text from the database? I guess this is also possibly with unity? But I don't know if it makes sense?
@CocoCode
3 жыл бұрын
Sure! Unity does not have any built in database support - you'd need to use some kind of asset. You can also create a csv file with all the data and create a simple importer.
Пікірлер: 112