r/Unity3D – Telegram
r/Unity3D
264 subscribers
12.6K photos
15.6K videos
14 files
48K links
News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
Basic mechanics for a cute soft-body physics game – what do you think? 🙂

https://redd.it/1i7kejc
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Have you ever spent way too much time on a little thing for your game only to then scrap it and forget about it? Just found and finished this chemical flask shader for our escape room game. Last time I worked on it was probably a year ago...

https://redd.it/1i7m7r2
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
I needed to add splitters and mergers to my farm product automation game. And I thought, why just 3 in and out?! What do you guys think? I hope it will work well logistically (needs some tests)

https://redd.it/1i7ki53
@r_Unity3D
Story looping back issue with Ink

Hi, I'm running into a bug when using Ink in my project, where at the first chance the player can select from choices, the dialogue panel closes. The console is printing Debug messages I wrote showing that for some reason, after the player makes their choice, the story is looping back to the main knot rather than proceeding.

I don't think it's an issue with my Ink noscript because it runs fine in Inky.

I think it's something in my dialogue manager? I built it from a tutorial and I've done my best to understand it, but since I'm a beginner it's definitely a challenge. Thank you for any help anyone can provide. I'll attach my DialogueManager noscript as well as my Ink noscript.

[Here is the console log.](https://imgur.com/a/0B5P0vU)

FYI: In this dialogue manager noscript I removed any mentions of the tags, just to try to debug. So this noscript isn't doing anything with the choices at this point. I'm just trying to proceed through the whole Ink story.

-> main

=== main ===
Welcome to the platform.
Now that you're here, would you like an extra ability?
* [Yes]
Excellent, what ability would you like?
* * [An extra-high jump!] -> high_jump

* * [More speed] -> speed_boost

* * [Make me bigger] -> make_bigger

* [No]
Come on, choose an ability -> main


=== high_jump ===
#ability: high_jump
You chose high jump
-> END

=== speed_boost ===
#ability: speed_boost
You chose speed_boost
-> END

=== make_bigger ===
#ability: make_bigger
-> END

using UnityEngine;
using TMPro;
using Ink.Parsed;
using System.Collections.Generic;
using Ink.Runtime;
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 Ink.Runtime.Story currentStory;

public bool dialogueIsPlaying { get; private set; }

private static DialogueManager instance;

private void Awake()
{
if (instance != null)
{
Debug.LogWarning("More than one instance of DialogueManager found!");
}
instance = this;
}

public static DialogueManager GetInstance()
{
return instance;
}

private void Start()
{
dialoguePanel.SetActive(false);
dialogueIsPlaying = false;

// get all of the choices text
choicesText = new TextMeshProUGUI[choices.Length];
int index = 0;
foreach (GameObject choice in choices)
{
choicesText[index] = choice.GetComponentInChildren<TextMeshProUGUI>();
index++;
}

}

private void Update()
{
if (!dialogueIsPlaying)
{
return;
}

if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("Return key pressed.");
ContinueStory();
}
}

public void EnterDialogueMode(TextAsset inkJSON)
{
Debug.Log("EnterDialogueMode called");
currentStory = new Ink.Runtime.Story(inkJSON.text);
dialoguePanel.SetActive(true);
dialogueIsPlaying = true;

ContinueStory();
}

private void ExitDialogueMode()
{
Debug.Log("Exiting dialogue mode triggered");
dialogueIsPlaying = false;
dialoguePanel.SetActive(false);
dialogueText.text = "";
}

private void ContinueStory()
{
Debug.Log("Calling ContinueStory.
Can continue: " + currentStory.canContinue);

if (currentStory.canContinue)
{
dialogueText.text = currentStory.Continue();
Debug.Log("Displaying line: " + dialogueText.text);
DisplayChoices();
}
else
{
Debug.Log("Exiting dialogue mode from ContinueStory.");
dialogueText.text = "Press Enter to exit the dialogue.";
StartCoroutine(WaitBeforeExit());
}
}

private void DisplayChoices()
{
List<Ink.Runtime.Choice> currentChoices = currentStory.currentChoices;

Debug.Log("Total choices available: " + currentChoices.Count); // Verify the number of choices
foreach (var choice in currentChoices)
{
Debug.Log("Choice: " + choice.text); // Print each choice text
}

int index = 0;
foreach (Ink.Runtime.Choice choice in currentChoices)
{
choices[index].gameObject.SetActive(true);
choicesText[index].text = choice.text;
Debug.Log($"Enabling choice button {index} with text: {choice.text}");
index++;
}

for (int i = index; i < choices.Length; i++)
{
Debug.Log($"Disabling unused choice button {i}");
choices[i].gameObject.SetActive(false);
}

StartCoroutine(SelectFirstChoice());
}

private System.Collections.IEnumerator SelectFirstChoice()
{
Debug.Log("Selecting the first choice button");
// Event System requires we clear it first, then Wait
// for at least one frame before setting the current selected game object
EventSystem.current.SetSelectedGameObject(null);
yield return new WaitForEndOfFrame();
EventSystem.current.SetSelectedGameObject(choices[0].gameObject);
}

public void MakeChoice(int choiceIndex)
{
Debug.Log($"MakeChoice called with index: {choiceIndex}");

currentStory.ChooseChoiceIndex(choiceIndex);

// Log current path in the Ink story
Debug.Log("After making a choice:");
Debug.Log("Current text: " + currentStory.currentText);
Debug.Log("Can continue: " + currentStory.canContinue);
Debug.Log("Choices available: " + currentStory.currentChoices.Count);

if (currentStory.canContinue)
{
Debug.Log("Story can continue. Calling ContinueStory.");
ContinueStory();
}
else
{
Debug.Log("Story cannot continue. Exiting dialogue.");
StartCoroutine(WaitBeforeExit());
}
}

private System.Collections.IEnumerator WaitBeforeExit()
{
Debug.Log("Waiting for user input to exit...");
yield return new WaitUntil(() => Input.GetKeyDown(KeyCode.Return)); // Wait for user input
Debug.Log("User input detected, exiting dialogue");
ExitDialogueMode();
}

}






https://redd.it/1i7orux
@r_Unity3D
Why is this happening? I splice my player and it makes it HUGE?

So to get the pivot point at the bottom of the feet I always do this. Change to multiple then auto splice at bottom.

It has always worked until now. The player has a 5 PNG attack. Well PNG's 1-3 work fine.

But the last 2 are doing this: https://imgur.com/a/xDCYEX8

I have never seen this before and don't know how to fix or make it go away. Basically the red part I marked out is the actual PNG. But it seems to have made invisible spaces before and after.

So when the animation plays there are frames where you can't see anything. Very odd.

Anyone have any ideas?
The only workaround I could do is to not splice this attack and have all the pivot points be in the default center.
I could do this but IDK if it will cause problems in the future or not.

https://redd.it/1i7sfdm
@r_Unity3D
Why do my pixels render like this? (Using Cinemachine)

https://youtu.be/5811VzGaY_o

Why does my pixel art randomly stretch the pixels in animations? When viewing the sprites individually on the same character, the pixels are not stretched. The only thing the animations do is change the sprite, it doesn't change the scale or anything. Why is this happening?

My cameras are pixel perfect as well

https://redd.it/1i7snjf
@r_Unity3D
When I splice my PNG it turns into an animation?? wtf?

Hey, so I my spicing on 1 single PNG is messing up. Its the same size and the 5th png in a sprite sheet. Well they are all separate PNGs that I combine to make animations.

Anyway, for some reason it keeps making this 5th PNG a freaking animation when I try to drag it into the scene.

I have no idea why. Its the same size resoultion/etc as all the other PNGS. Something is going wrong when I splice it.

Any ideas?

https://redd.it/1i7u6yi
@r_Unity3D
It jumps very fast

https://preview.redd.it/f3g6soki5oee1.png?width=1126&format=png&auto=webp&s=e70b40cbc289bd5d79ca98c6bdfbf773609447ee

I have a character that I’m making jump, but the jump happens way too fast and doesn’t look natural at all. How can I make the jump feel smoother and more realistic? (I have a video, but I couldn’t figure out how to upload it to Reddit yet! :)) Thanks in advance for any suggestions!

https://redd.it/1i7v5uy
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
First time doing voice acting for my horror game feedback is needed

https://redd.it/1i7v1n7
@r_Unity3D
As a child, I always loved looking at the goods in kiosks—there were so many, and I dreamed of being a seller one day. Years later, I partially fulfilled that dream by creating a game. What do you think?
https://www.youtube.com/watch?v=Gvlp8MHFWjE

https://redd.it/1i7xj7h
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
Sense Of Speed: Sense of Speed:
1. FOV change based on speed
2. Camera Shake at high speed
3. Motion Blur
4. Speed Lines

https://redd.it/1i7ygiu
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Any tips on how to pull off some Lighting like this wherein its night, but it isn't dark? [Game: Wuthering Waves]

https://redd.it/1i7yvbf
@r_Unity3D
Custom retro cartoon shader, full evolution from the original demo to the PlayStation build.
https://redd.it/1i80r09
@r_Unity3D