In this video, I show how to persist variables across multiple Ink stories using a Variable Observer.
As an added bonus, I also show how to use the system to change something in the game based on something that happens in the Ink dialogue.
This can be used to add cause/effect between Ink stories and also to change things in the game depending on variables set in the Ink dialogue file.
Thank you for watching and I hope the video was helpful! 🙂
► INK + UNITY TUTORIAL PLAYLIST
The full Ink + Unity tutorial playlist that this video is part of can be found here.
https://www.youtube.com/watch?v=KSRpcftVyKg&list=PL3viUl9h9k78KsDxXoAzgQ1yRjhm7p8kl
► TIMESTAMPS
0:00 Intro
1:09 How it's going to work
3:47 Setting up the globals ink file
6:24 Creating the variable observer
9:00 Initializing the dictionary
11:07 Maintaining the dictionary
12:19 Referencing the dictionary
14:09 Outro
► OTHER UNITY DIALOGUE SYSTEM TUTORIALS
Here's a playlist containing all of the tutorials I've done around creating a Dialogue System in Unity.
https://www.youtube.com/watch?v=KSRpcftVyKg&list=PL3viUl9h9k78KsDxXoAzgQ1yRjhm7p8kl
► GITHUB PROJECT
The '4-typing-effect-implemented' branch is what we started with at the beginning of this video, and the '5-variables-persisted' branch is the final result by the end of this video.
https://github.com/shapedbyrainstudios/ink-dialogue-system
► MUSIC
The backing music is custom made by @themaykit.
https://www.instagram.com/themaykit/
► DISCORD
Come ask questions, suggest a video topic, or just hang out!
📱Discord ➔ https://discord.gg/99gcnaHFf9
► THE PATH OF REN
Wishlist The Path of Ren on Steam!
🎮 Steam (The Path of Ren) ➔ https://store.steampowered.com/app/1619920
► SOCIAL MEDIA LINKS
🐦 Twitter ➔ https://twitter.com/ShapedByRain
📷 Instagram ➔ https://instagram.com/ShapedByRainStudios
🕑 TikTok ➔ https://tiktok.com/@ShapedByRainStudios
🌐 Website ➔ https://ShapedByRainStudios.com
► SUPPORT
Any support is much appreciated! I may receive a commission on any assets purchased using the below Unity Asset Store link.
🛍️ Unity Asset Store Affiliate Link ➔ https://assetstore.unity.com/?aid=1100lrxm5
☕ Buy me a coffee! (Ko-fi) ➔ https://ko-fi.com/ShapedByRainStudios
#gamedev #unity2d #unity