New answers tagged

0

Here's a simple script that accomplishes an effect like the one in your video. Put it on a UI object that's the parent container of your stack of images. using UnityEngine; using UnityEngine.UI; using UnityEngine.Events; public class CardStack : MonoBehaviour { [Tooltip("What gamepad/keyboard button action ID should trigger the next card?")] ...


0

Unity in particular actually happens to provide some powerful tools for writing editor extensions and to create game-specific asset types (Scriptable Objects). So you can actually create pretty extensive content management tools tailored to your game within the engine itself. But if your engine doesn't have such powerful customization features, then it can ...


3

This occurs because you're displaying your sprite at a size on screen such that there's a non-integer ratio between the number of screen pixels it occupies, and the number of source texels in the sprite. That means that somewhere, some source texels need to be displayed more times than others to fill the space, and which ones get repeated/skipped depends on ...


0

Been a long time since this one was asked. I just had a similar issue crop up and it was because an invisible portion of another text UI element was covering part of my button.


1

It looks to me like you might want to use some custom data structures for this. First, one for your character: [CreateAssetMenu(fileName="NewDialogueCharacter.Asset", menuName = "Dialogue/Character")] public class DialogueCharacter : ScriptableObject { public Sprite portrait; public Sprite nameTag; public Color32 colour; } That will give you ...


0

For 2D UI you typically achieve this by using an orthographic projection matrix, and setting view and model to identity, which collapses the typical transform: gl_Position = projection * view * model * vec4(position, 1); To: gl_Position = projection * vec4(position, 1); So yes, this approach is correct. To lay out the UI elements, there are a number of ...


0

This may be updated in the newer version, I applied the Material created with Render Target to the Image in the Brush settings of my Widget BP which Material Domain needs to be "User Interface". Then the Render Target material should be shown properly in the widget even in the viewport.


0

Keeping track of time You likely already figured out that the best way to keep track of time left in Unity is to have a private float variable which gets initialized to the starting time and then gets reduced by Time.deltaTime in the Update method: secondsLeft -= Time.deltaTime; Creating a UI timer But the problem is that Unity does not provide a ...


0

Camera Stacks are now part of Unity's Universal Render Pipeline (URP). You can add an overlay camera over your main scene camera to render the particles - https://bdts.com.au/tips-and-resources/unity-ui-particles-in-urp-using-overly-cameras-and-camera-stacks.html


0

I couldn't figure out what Konrad's variables were supposed to mean in my game (map width? My map is infinite, so... that's the same as the screen width then maybe? It didn't work out), so I figured it out from scratch. The way I figured: (TL;DR: read only the bold parts.) When zooming, some pixels drop off the screen (zooming in) or newly become visible ...


0

4 years later but I bring an answer that solved it for me. This is using a World Space Canvas and I was trying to instantiate a prefab (menu) menu.GetComponent().anchoredPosition3D = this.GetComponent().anchoredPosition3D; "this" being the parent I think what was messing it up for me was that since I'd been at this for a while I tried the same thing you ...


Top 50 recent answers are included