error CS1503: Argument 1: cannot convert from 'void' to 'string'
I've been following a youtube tutorial for using Inky (dialogue code program) for making choices and a dialogue system in Unity, and am currently getting this error in my dialogue manager c#:
error CS1503: Argument 1: cannot convert from 'void' to 'string'
Below is the code entirely, but its specifically for the block 94 (private void continue story), specifically line 105. I would appreciate any help or advice at all, I'm super new to Unity and its lingo, and have fiddled around with what it might be to no avail.
The specific code section:
private void ContinueStory()
{
if (currentStory.canContinue)
{
// set text for the current dialogue line
dialogueText.text = currentStory.Continue();
// display choices if any for this dialogue line
DisplayChoices();
}
else
{
StartCoroutine(ExitDialogueMode());
}
}
The entire code file:
using UnityEngine;
using TMPro;
using Ink.Runtime;
using System.Collections.Generic;
using System.Collections;
using UnityEngine.EventSystems;
public class DialogueManager : MonoBehaviour
{
Header("Dialogue UI")
SerializeField private GameObject dialoguePanel;
SerializeField private TextMeshProUGUI dialogueText;
Header("Choices UI")
SerializeField private GameObject choices;
private TextMeshProUGUI choicesText;
private Story currentStory;
public bool dialogueIsPlaying;
private static DialogueManager instance;
private void Awake()
{
if (instance != null)
{
Debug.LogWarning("Found more than one Dialogue Manager in the scene");
}
instance = this;
}
public static DialogueManager GetInstance()
{
return instance;
}
private void Start()
{
dialogueIsPlaying = false;
dialoguePanel.SetActive(false);
// get all of the choices text
choicesText = new TextMeshProUGUIchoices.Length;
int index = 0;
foreach (GameObject choice in choices)
{
choicesTextindex = choice.GetComponentInChildren<TextMeshProUGUI>();
index++;
}
}
private void Update()
{
if (!dialogueIsPlaying)
{
return;
}
if (InputManager.GetInstance().GetSubmitPressed())
{
ContinueStory();
}
// handle continuing to the next line in the dialogue when submit is pressed
if (currentStory.currentChoices.Count == 0 && InputManager.GetInstance().GetSubmitPressed())
{
ContinueStory();
}
}
public void EnterDialogueMode(TextAsset inkJSON)
{
currentStory = new Story(inkJSON.text);
dialogueIsPlaying = true;
dialoguePanel.SetActive(true);
ContinueStory();
}
private void ExitDialogueMode()
{
dialogueIsPlaying = false;
dialoguePanel.SetActive(false);
dialogueText.text = "";
}
private void ContinueStory()
{
if (currentStory.canContinue)
{
// set text for the current dialogue line
dialogueText.text = currentStory.Continue();
// display choices if any for this dialogue line
DisplayChoices();
}
else
{
StartCoroutine(ExitDialogueMode());
I've been following a youtube tutorial for using Inky (dialogue code program) for making choices and a dialogue system in Unity, and am currently getting this error in my dialogue manager c#:
error CS1503: Argument 1: cannot convert from 'void' to 'string'
Below is the code entirely, but its specifically for the block 94 (private void continue story), specifically line 105. I would appreciate any help or advice at all, I'm super new to Unity and its lingo, and have fiddled around with what it might be to no avail.
The specific code section:
private void ContinueStory()
{
if (currentStory.canContinue)
{
// set text for the current dialogue line
dialogueText.text = currentStory.Continue();
// display choices if any for this dialogue line
DisplayChoices();
}
else
{
StartCoroutine(ExitDialogueMode());
}
}
The entire code file:
using UnityEngine;
using TMPro;
using Ink.Runtime;
using System.Collections.Generic;
using System.Collections;
using UnityEngine.EventSystems;
public class DialogueManager : MonoBehaviour
{
Header("Dialogue UI")
SerializeField private GameObject dialoguePanel;
SerializeField private TextMeshProUGUI dialogueText;
Header("Choices UI")
SerializeField private GameObject choices;
private TextMeshProUGUI choicesText;
private Story currentStory;
public bool dialogueIsPlaying;
private static DialogueManager instance;
private void Awake()
{
if (instance != null)
{
Debug.LogWarning("Found more than one Dialogue Manager in the scene");
}
instance = this;
}
public static DialogueManager GetInstance()
{
return instance;
}
private void Start()
{
dialogueIsPlaying = false;
dialoguePanel.SetActive(false);
// get all of the choices text
choicesText = new TextMeshProUGUIchoices.Length;
int index = 0;
foreach (GameObject choice in choices)
{
choicesTextindex = choice.GetComponentInChildren<TextMeshProUGUI>();
index++;
}
}
private void Update()
{
if (!dialogueIsPlaying)
{
return;
}
if (InputManager.GetInstance().GetSubmitPressed())
{
ContinueStory();
}
// handle continuing to the next line in the dialogue when submit is pressed
if (currentStory.currentChoices.Count == 0 && InputManager.GetInstance().GetSubmitPressed())
{
ContinueStory();
}
}
public void EnterDialogueMode(TextAsset inkJSON)
{
currentStory = new Story(inkJSON.text);
dialogueIsPlaying = true;
dialoguePanel.SetActive(true);
ContinueStory();
}
private void ExitDialogueMode()
{
dialogueIsPlaying = false;
dialoguePanel.SetActive(false);
dialogueText.text = "";
}
private void ContinueStory()
{
if (currentStory.canContinue)
{
// set text for the current dialogue line
dialogueText.text = currentStory.Continue();
// display choices if any for this dialogue line
DisplayChoices();
}
else
{
StartCoroutine(ExitDialogueMode());
}
}
public void MakeChoice(int choiceIndex)
{
currentStory.ChooseChoiceIndex(choiceIndex);
ContinueStory();
}
private void DisplayChoices()
{
List<Choice> currentChoices = currentStory.currentChoices;
// defensive check to make sure our UI can support the number of choices coming in
if (currentChoices.Count > choices.Length)
{
Debug.LogError("More choices were given than the UI can support. Number of choices given: " + currentChoices.Count);
}
int index = 0;
// enable and initialize the choices up to the amount of choices for this line of dialogue
foreach(Choice choice in currentChoices)
{
choicesindex.gameObject.SetActive(true);
choicesTextindex.text = choice.text;
index++;
}
// go through the remaining choices the UI supports and make sure they're hidden
for (int i = index; i < choices.Length; i++)
{
choicesi.gameObject.SetActive(false);
}
StartCoroutine(SelectFirstChoice());
}
private IEnumerator SelectFirstChoice()
{
// Event System requires we clear it first, then wait
// for at least one frame before we set the current selected object
EventSystem.current.SetSelectedGameObject(null);
yield return new WaitForEndOfFrame();
EventSystem.current.SetSelectedGameObject(choices0.gameObject);
}
//public void MakeChoice(int choiceIndex)
//{
// currentStory.ChooseChoiceIndex(choiceIndex);
//}
}
I've researched a bit and can't figure it out. Here is the tutorial i've been following as well https://www.youtube.com/watch?v=vY0Sk93YUhA&list=LL&index=16&t=1524s
Thank you for any help TvT
https://redd.it/1ppd5c3
@r_Unity3D
}
public void MakeChoice(int choiceIndex)
{
currentStory.ChooseChoiceIndex(choiceIndex);
ContinueStory();
}
private void DisplayChoices()
{
List<Choice> currentChoices = currentStory.currentChoices;
// defensive check to make sure our UI can support the number of choices coming in
if (currentChoices.Count > choices.Length)
{
Debug.LogError("More choices were given than the UI can support. Number of choices given: " + currentChoices.Count);
}
int index = 0;
// enable and initialize the choices up to the amount of choices for this line of dialogue
foreach(Choice choice in currentChoices)
{
choicesindex.gameObject.SetActive(true);
choicesTextindex.text = choice.text;
index++;
}
// go through the remaining choices the UI supports and make sure they're hidden
for (int i = index; i < choices.Length; i++)
{
choicesi.gameObject.SetActive(false);
}
StartCoroutine(SelectFirstChoice());
}
private IEnumerator SelectFirstChoice()
{
// Event System requires we clear it first, then wait
// for at least one frame before we set the current selected object
EventSystem.current.SetSelectedGameObject(null);
yield return new WaitForEndOfFrame();
EventSystem.current.SetSelectedGameObject(choices0.gameObject);
}
//public void MakeChoice(int choiceIndex)
//{
// currentStory.ChooseChoiceIndex(choiceIndex);
//}
}
I've researched a bit and can't figure it out. Here is the tutorial i've been following as well https://www.youtube.com/watch?v=vY0Sk93YUhA&list=LL&index=16&t=1524s
Thank you for any help TvT
https://redd.it/1ppd5c3
@r_Unity3D
YouTube
How to make a Dialogue System with Choices in Unity2D | Unity + Ink tutorial
In this video, I show how to make a dialogue system with choices for a 2D game in Unity.
The dialogue system features Ink, which is an open source narrative noscripting language for creating video game dialogue that integrates nicely with Unity.
Thank you…
The dialogue system features Ink, which is an open source narrative noscripting language for creating video game dialogue that integrates nicely with Unity.
Thank you…
Is Using Float for Money in Unity a Bad Idea?
Hello,
In games like Supermarket Simulator, House Flipper, and similar noscripts, are in-game currency, product costs, and other economic values usually stored as float, or as int / long?
I’ve been developing a game for about two months, and currently all of my economy calculations are handled using float. I’ve tried to avoid floating-point precision issues as much as possible by using functions like Mathf.Max and Mathf.Round.
However, do you think using float for money is a mistake?
Would it have been better to store currency as int or long, for example by representing money in cents?
How is money typically handled in simulator games, especially in Unity?
https://redd.it/1pp9l4m
@r_Unity3D
Hello,
In games like Supermarket Simulator, House Flipper, and similar noscripts, are in-game currency, product costs, and other economic values usually stored as float, or as int / long?
I’ve been developing a game for about two months, and currently all of my economy calculations are handled using float. I’ve tried to avoid floating-point precision issues as much as possible by using functions like Mathf.Max and Mathf.Round.
However, do you think using float for money is a mistake?
Would it have been better to store currency as int or long, for example by representing money in cents?
How is money typically handled in simulator games, especially in Unity?
https://redd.it/1pp9l4m
@r_Unity3D
Reddit
From the Unity3D community on Reddit
Explore this post and more from the Unity3D community
As an Asset Store publisher, frequent updates didn’t improve discoverability — is this expected?
I maintain a few assets on the Unity Asset Store and I’ve been trying to do the “right” thing by pushing regular updates that actually add value, not just bug fixes.
What surprised me is that updating doesn’t seem to change anything in terms of visibility or sales. The asset doesn’t resurface anywhere, most users don’t even notice the update, and traffic basically stays the same.
Meanwhile it looks like brand-new releases, heavy discounts, or spinning the same tool into a separate “v2” asset get way more exposure.
From both a publisher and a user point of view, this feels kind of backwards. It almost discourages long-term maintenance and encourages throwing out new SKUs instead.
For people who’ve been around the Asset Store longer (publishers or power users): is this just how the store is designed, or am I missing something obvious?
https://redd.it/1ppln8n
@r_Unity3D
I maintain a few assets on the Unity Asset Store and I’ve been trying to do the “right” thing by pushing regular updates that actually add value, not just bug fixes.
What surprised me is that updating doesn’t seem to change anything in terms of visibility or sales. The asset doesn’t resurface anywhere, most users don’t even notice the update, and traffic basically stays the same.
Meanwhile it looks like brand-new releases, heavy discounts, or spinning the same tool into a separate “v2” asset get way more exposure.
From both a publisher and a user point of view, this feels kind of backwards. It almost discourages long-term maintenance and encourages throwing out new SKUs instead.
For people who’ve been around the Asset Store longer (publishers or power users): is this just how the store is designed, or am I missing something obvious?
https://redd.it/1ppln8n
@r_Unity3D
Reddit
From the Unity3D community on Reddit
Explore this post and more from the Unity3D community
Unity Enterprise Minimum Commitment Program
https://mobilegamer.biz/unity-risks-fresh-backlash-with-new-fee-demands-this-feels-like-blackmail
I’m a freelance dev who earns about $35K/yr from one of my clients, building a free medical app for a big healthcare company.
Unity’s rules say that if you develop for a client, their revenue counts as yours — so because the company makes $250M+, Unity says I’m not allowed to use Personal and should be on Enterprise/Industry pricing.
Now rumors say Unity wants six-figure minimum fees for Enterprise clients.
In my case if this new fee goes into place my client would need to pay for 2 million in Unity services.
My client compains about paying me $35K, let alone $250K+ for licenses.
The app makes zero revenue.
So I basically can’t use Unity at all anymore.
https://redd.it/1ppqumd
@r_Unity3D
https://mobilegamer.biz/unity-risks-fresh-backlash-with-new-fee-demands-this-feels-like-blackmail
I’m a freelance dev who earns about $35K/yr from one of my clients, building a free medical app for a big healthcare company.
Unity’s rules say that if you develop for a client, their revenue counts as yours — so because the company makes $250M+, Unity says I’m not allowed to use Personal and should be on Enterprise/Industry pricing.
Now rumors say Unity wants six-figure minimum fees for Enterprise clients.
In my case if this new fee goes into place my client would need to pay for 2 million in Unity services.
My client compains about paying me $35K, let alone $250K+ for licenses.
The app makes zero revenue.
So I basically can’t use Unity at all anymore.
https://redd.it/1ppqumd
@r_Unity3D
Mobilegamer.biz
Unity risks fresh backlash with new fee demands: “This feels like blackmail”
Unity Enterprise licences will be revoked if studios don’t pay a new fee based on annual revenue, we’re told.
Baked lighting changes everything - comparison of realtime vs baked
https://redd.it/1ppt39i
@r_Unity3D
https://redd.it/1ppt39i
@r_Unity3D
Reddit
From the Unity3D community on Reddit: Baked lighting changes everything - comparison of realtime vs baked
Explore this post and more from the Unity3D community
Our artist likes Top Gun and birds so we were forced him to make a bird region in our game
https://www.youtube.com/watch?v=qdovV6ajOUk
https://redd.it/1ppujxq
@r_Unity3D
https://www.youtube.com/watch?v=qdovV6ajOUk
https://redd.it/1ppujxq
@r_Unity3D
YouTube
Apocalypse Express - 0.3 - The Viaducts
Welcome to Apocalypse Express 0.3! Enter the new biome, The Viaducts, and battle the Aviators! Pack your train at the Loading bay to customize the difficulty of your runs and gain rewards doing so. Reveal fortunes at the Tarot Reader to gain buffs for your…
Want to make my own pixel art rpg game one day, where to start?
I have the smallest amount of coding experience, if you can even call it that, but forgot most of it so im basically a blank slate, I have access to quite alot of software thanks to school and would love to lean how to start coding for video games my end goal making a pixel art rpg game inspired by many other of my favorite games. I was wondering where the best place to start is, I already asume its coding, but I have no idea what resources to use.
https://redd.it/1ppxor5
@r_Unity3D
I have the smallest amount of coding experience, if you can even call it that, but forgot most of it so im basically a blank slate, I have access to quite alot of software thanks to school and would love to lean how to start coding for video games my end goal making a pixel art rpg game inspired by many other of my favorite games. I was wondering where the best place to start is, I already asume its coding, but I have no idea what resources to use.
https://redd.it/1ppxor5
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Turn your own images into on-style game assets (Reference Image)
We added **Reference Image** to [Gametank ](https://www.gametank.com/)(2D asset generator).
Upload your own image (person, pet, prop, mark) and get a **style-matched output** aligned to your workflow selections (genre, art style, palette, perspective).
**Why this helps for games**
* **Engine-ready PNGs**: transparent backgrounds where appropriate (sprites, items, UI), plus consistent **centering, padding, and tile sizes**—drop results straight into your project.
* **On-model sets**: it’s easier to make 10–20 assets that actually match; “Repeat setup” keeps style/palette/perspective locked across runs.
* **Prompt-only edits** also preserve transparency, so you can make small pose/color tweaks without cleanup.
**How it works (final step)**
1. Finish your usual workflow
2. **Upload reference** (PNG/JPG ≤ 5 MB)
3. Short prompt → **Generate**
*Disclosure: I’m one of the makers—happy to answer any questions you may have.*
https://redd.it/1pq0m4c
@r_Unity3D
We added **Reference Image** to [Gametank ](https://www.gametank.com/)(2D asset generator).
Upload your own image (person, pet, prop, mark) and get a **style-matched output** aligned to your workflow selections (genre, art style, palette, perspective).
**Why this helps for games**
* **Engine-ready PNGs**: transparent backgrounds where appropriate (sprites, items, UI), plus consistent **centering, padding, and tile sizes**—drop results straight into your project.
* **On-model sets**: it’s easier to make 10–20 assets that actually match; “Repeat setup” keeps style/palette/perspective locked across runs.
* **Prompt-only edits** also preserve transparency, so you can make small pose/color tweaks without cleanup.
**How it works (final step)**
1. Finish your usual workflow
2. **Upload reference** (PNG/JPG ≤ 5 MB)
3. Short prompt → **Generate**
*Disclosure: I’m one of the makers—happy to answer any questions you may have.*
https://redd.it/1pq0m4c
@r_Unity3D
Asking advice: video clip playback on WebGL build
So, got this super simple game consisting of 2 scenes. First scene: intromovie.mp4. Second scene: the demo.
Normal PC build works fine. Ok not something I am totally happy, but it starts up and does things. Intro scene first, plays video. Automatically followed by game scene with "start game button". Good enough for now.
Alas!, the webgl build runs only when i build only the gamescene. I just cant get the intro scene work. I try out different things, and at best i see backroud and a pink square. If i build with introscene and gamescene, game just freezes after unity logo and shows basic blue backroud.
The introscene has few things: main camera, canva + child object to hold video component + some sort of noscript AI game to autoplay the video on scene start. Basicly, this is the simplest thing I done on my 4 weeks with unity. Should work! :D
But it does not work. There must be something very basic I am doing wrong or forgetting. I just cant find info on net what it could be. I would have asked unity forums but yeh its not available now.
Thanks and kudos for all you guys who answer us l33t n00bs.
https://redd.it/1pq0pim
@r_Unity3D
So, got this super simple game consisting of 2 scenes. First scene: intromovie.mp4. Second scene: the demo.
Normal PC build works fine. Ok not something I am totally happy, but it starts up and does things. Intro scene first, plays video. Automatically followed by game scene with "start game button". Good enough for now.
Alas!, the webgl build runs only when i build only the gamescene. I just cant get the intro scene work. I try out different things, and at best i see backroud and a pink square. If i build with introscene and gamescene, game just freezes after unity logo and shows basic blue backroud.
The introscene has few things: main camera, canva + child object to hold video component + some sort of noscript AI game to autoplay the video on scene start. Basicly, this is the simplest thing I done on my 4 weeks with unity. Should work! :D
But it does not work. There must be something very basic I am doing wrong or forgetting. I just cant find info on net what it could be. I would have asked unity forums but yeh its not available now.
Thanks and kudos for all you guys who answer us l33t n00bs.
https://redd.it/1pq0pim
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Hey, r/Unity3D - Zu from the Learn Team here!
Hello everyone, my name is Zu!
I am part of the Unity Learn team at Unity!
We do some really cool things over at the Unity Learn website and I would love to come here more often to share it with you!
I have actually been lurking in this subreddit for a while and decided it is my time to come along and chat with you all about everything to do with learning Unity. I would love to hear about your thoughts and ideas regarding our learning resources!
Whether you are just starting with Unity or are more interested in specific intermediate or advanced skills, I would love to know what you are working on right now using Unity!
– Zu
Associate Producer @ Unity
https://redd.it/1ppw8h0
@r_Unity3D
Hello everyone, my name is Zu!
I am part of the Unity Learn team at Unity!
We do some really cool things over at the Unity Learn website and I would love to come here more often to share it with you!
I have actually been lurking in this subreddit for a while and decided it is my time to come along and chat with you all about everything to do with learning Unity. I would love to hear about your thoughts and ideas regarding our learning resources!
Whether you are just starting with Unity or are more interested in specific intermediate or advanced skills, I would love to know what you are working on right now using Unity!
– Zu
Associate Producer @ Unity
https://redd.it/1ppw8h0
@r_Unity3D
Unity Learn
Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn
Free tutorials, courses, and guided pathways for mastering real-time 3D development skills to make video games, VR, AR, and more.
What a good size to a backgroud?
I'm creating my first game, a 2D top-view, and now I'm trying to create the map, but I dont know what's the size to do it. I'm using the Krita (a drawing software), do someone know what px size I have to use?
https://redd.it/1pq75vh
@r_Unity3D
I'm creating my first game, a 2D top-view, and now I'm trying to create the map, but I dont know what's the size to do it. I'm using the Krita (a drawing software), do someone know what px size I have to use?
https://redd.it/1pq75vh
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Mobile Monetization Tool That May Help Your Mobile Game Unity Project
http://youtube.com/watch?v=gVyTTkQWqRc&list=PLHcU8LK4tXHxxhGk7g993czfDWD9_BVNL&index=1
https://redd.it/1pqg21b
@r_Unity3D
http://youtube.com/watch?v=gVyTTkQWqRc&list=PLHcU8LK4tXHxxhGk7g993czfDWD9_BVNL&index=1
https://redd.it/1pqg21b
@r_Unity3D
YouTube
Mobile Monetization Pro V2 – Official Trailer | All-in-One Unity Mobile Game Monetization Tool
🚀 Introducing **Mobile Monetization Pro V2** – the all-in-one monetization solution for your Unity mobile games!
This trailer gives you a quick look at what the tool offers and why it’s perfect for developers who want to integrate **Ads, IAPs, GDPR, ATT…
This trailer gives you a quick look at what the tool offers and why it’s perfect for developers who want to integrate **Ads, IAPs, GDPR, ATT…