Questions tagged [unity]

Unity is a cross-platform game creation system that focuses on easy art pipeline process. It consists of a game engine and an integrated development environment. The game engine's scripting is built on Mono.

Filter by
Sorted by
Tagged with
1 vote
1 answer
207 views

How to programmatically activate the Glow option in a Text Mesh Pro font

I can activate the Glow setting for a Font in Text Mesh Pro by checking the Glow checkbox: Is there a way I can programmatically do the same thing? I looked in the corresponding shader, and found ...
user avatar
  • 207
0 votes
0 answers
24 views

How do I switch between swipe and pan in Unity in one touch?

I am trying to create a gesture handler that can detect both swipes/pans - within one touch - in Unity. I should be able, within one touch event, to pan slowly to the left or right. During the same ...
user avatar
0 votes
1 answer
64 views

How can I make a hole in ground to fall into an other terrain

I am new to game development, and I need to make a game where the player digs a hole in the ground anywhere on the terrain like this game but there will be no limit the player will dig until he fell ...
user avatar
  • 1
0 votes
1 answer
26 views

I have set my animation to play when the player enters a set area a through script but it's not playing

I have set my animation to play through a script I made but it's not playing. I have all the references correct my spelling is correct as well. My code: ...
user avatar
  • 13
1 vote
0 answers
24 views

How to distinguish pointer up inside button vs drag-out

I am making a unity mobile game, I have a simple scene and a canvas with a few buttons and these buttons have scripts that detect if the button was pressed and released. Here is the code for doing ...
user avatar
  • 11
0 votes
1 answer
34 views

How does one detect a button release with Unity's new input system?

I'm attempting to upgrade my technique from the classic input methods to the new Input System for Unity; but I'm finding it a little sprawling and unhelpful so far. I know that if I have an action, ...
user avatar
0 votes
1 answer
17 views

Why does setting blend mode in Unity shader graph to Multiply create artifacts on sprite?

I want my sprite to use a blend mode based on the background (like in Adobe programs) so I set shader graph blend mode to Multiply. The blend works, but I get strange artifacts on my sprite. In this ...
user avatar
  • 129
2 votes
1 answer
31 views

Getting a list of all supported characters in a Font

I am attempting to create my own font fallback system for multilanguage support using UI Toolkit in Unity (Label class). This UI system does not intrinsically support fallback fonts. I have some ...
user avatar
  • 227
0 votes
0 answers
12 views

How to find the vertices most rigidly skinned to each bone?

I'm trying to reimplement this paper in Unity: https://theorangeduck.com/media/uploads/other_stuff/DReCon.pdf To setup the character avatar, the authors write: "Our character’s rigid body ...
user avatar
  • 1
0 votes
0 answers
38 views

Cancel a task only if it gets re-run

I have a slow proc gen function that runs when a user changes any parameters. If a parameter is changed before it has completed, I want it to cancel the task and start a new one. Currently I have it ...
user avatar
0 votes
1 answer
18 views

Where to trigger load from PlayerPrefs for data in a static class?

I have this save system that saves screenshots in consecutively-numbered files. I store the number of the last number used in PlayerPrefs, so that the next save ...
user avatar
0 votes
0 answers
20 views

How to authenticate request for player info using Google Play Services?

I use this line of code to get the user server access token in Unity: PlayGamesPlatform.Instance.RequestServerSideAccess(true, Callback); the callback responds ...
user avatar
  • 2,458
0 votes
0 answers
30 views

Viewing Wrapper/Container Classes from a Scriptable Object inside of the Unity Inspector

I'm making a word game to teach kids how to read and promote literacy. As part of that, I made a Scriptable Object that's basically a bunch of nested Lists, until it reaches the bottom node: ...
user avatar
  • 207
0 votes
0 answers
20 views

Plastic SCM window shows up barely visible and white

I've recently started using Plastic to sync files between my laptop and computer. Everything has made sense until now, but I opened it today and the plastic window was white, unlike the normal grey of ...
user avatar
0 votes
1 answer
16 views

Hiding objects from the player when working with RenderTextures

I am currently working on a game that has monitors showing the player different elements such as texts, images and numbers. My plan for this is to use Unity's ...
user avatar
0 votes
0 answers
21 views

Creating a projection Line with Parabola effect

friends. I'm trying to achieve a effect that where when the enemy/player get close to the player/enemy a parabola is formed in direction to the enemy/player to represent that is target in that moment. ...
user avatar
0 votes
0 answers
24 views

How to download the visualization file for a protein from Alphafold DB to use in Unity [closed]

I am looking at something like this: https://alphafold.com/entry/Q9Y499 There is a nice visualization there which I want to replicate in Unity. There are download links for PDB, mmCIF and predicted ...
user avatar
0 votes
2 answers
50 views

What should I be aware if I use [SerializeField] to pass GameObjects?

In Unity, I am trying to disable a Game Object in the scene by passing it through SerializeField. I have read elsewhere that this was previously not possible and is inadvisable, but I seem to be able ...
user avatar
0 votes
0 answers
8 views

Unity VR Detect if object is being held

I am using the XR Interaction Manager in Unity VR. The player can hold objects when pressing the trigger button of the hands (the interactable object has the component XR Grab Interactable). I want to ...
user avatar
  • 137
0 votes
2 answers
13 views

Canvas element active by default even though it's set to inactive in the script

The pause menu is getting shown by default when I click the play button, even though the GameIsPaused boolean is set to false. I don't know if it's the fault of how ...
user avatar
0 votes
0 answers
13 views

Using native SDK's inside Unity

First of all, I would like to point out that I am not a Unity developer. Most of the programming is related to web programming, but my friends and I set out to create an MVP of one product inside ...
user avatar
  • 101
0 votes
2 answers
31 views

Flipping a sprite with SpriteRenderer.flipx when the pivot is not centered

My sprite has a pivot in the bottom left so that it snaps on the grid. Flipping the sprite with flipX almost works, but the sprite also shifts one quare to the left/right when flipping. Gif of ...
user avatar
0 votes
0 answers
24 views

How to make Items spawn when you combine two other items together

My Idea is to have Two Herbs from the Player's Inventory and give them particular Item IDs like: 2 Combined Herbs give you a Potion of Health. 2 different Herb combinations give you a Potion of ...
user avatar
0 votes
1 answer
37 views

How to count polygons in Unity?

The Rendering Stats (profiler) only shows tris and verts. But everyone keeps using the term polygon which doesn't exist in Unity's terminology. How can I get the polycount of my Unity scene?
user avatar
0 votes
0 answers
39 views

Blurry text in low resolution game using TMP

This could be a simple solution that my mind cant grab right now. So, I am working on a game with a specific resolution which is 64x64. I using unity latest version. as for my text I am using TMP. My ...
user avatar
  • 1
0 votes
1 answer
39 views

How to create a slideshow of Images in 2D game without pressing buttons

I want to make a slide of images that change automatically by a timer without pressing any button for example every 5 seconds the image changes to another one. I have a script but it only changes them ...
user avatar
0 votes
0 answers
17 views

How to viably store player position & state between scenes? [duplicate]

[The following is being constructed in Unity] Consider an RPG where the player enters different rooms and we must remember the last position the player was in ...
user avatar
0 votes
0 answers
21 views

Unity 2d - Creating Temporary Objects Within the Scope Of the Camera View

I want to create one large tilemap, and want objects placed on it like multiple blades of grass and trees. I want the tufts of grass and tree objects to be placed based on specific placeholder tiles ...
user avatar
0 votes
0 answers
18 views

Associate a set of strings with a set of images for a Key/Button Rebinding system

I'm creating a key rebinding system for my project. It detects when a key (including controller buttons) or mouse button is pressed and, when that input is detected, it takes the name of the key or ...
user avatar
0 votes
0 answers
12 views

How do I prevent a camera from rendering post-processing effects to a render texture in URP?

So here's my situation. I have two cameras in a game about a bee. The game uses the Universal Render Pipeline. One of them detects blooming terrain at a distance, and is sensitive to its own layer (...
user avatar
0 votes
0 answers
29 views

Unity 2D Parabolic character movement between platforms displays unexpected behaviour

I am trying to write an enemy AI that jumps between available platforms when it doesn't have ground below its feet. I want the character to do the jumps in a parabolic fashion rather than doing a ...
user avatar
0 votes
1 answer
40 views

Adding second light hides the first on iOS unless quality is set to high

When I add a light in the scene then the light will show on the ground, but when I add a second light, neither of them show on the ground. One light: Add second light: My light is a spot light, and ...
user avatar
0 votes
1 answer
17 views

How to change quaternion when flipping X axis?

For a given animation with the set of 3D coordinates of every joint and corresponding global rotations quaternions Q(X, Y, Z, W) in right-hand coordinates (Y-up, X-...
user avatar
0 votes
0 answers
40 views

SpriteRenderer shows stripe artifacts in build

The sprite renderer can render the sprite correctly in the Unity Play mode, but when I build the game, it can't render the sprite correctly, and there are stripes on the sprite. Here are the ...
user avatar
  • 1
0 votes
0 answers
19 views

How can I get a created saved game file's date and time format and add the date time format to slots of saved games in another scene?

I have two scenes: Game and Loading. In the Loading scene I have number of slots in this case 10 saved game slots and I can change the slots number each time. I want to make that when I'm saving the ...
user avatar
0 votes
1 answer
25 views

Get object rotation around the x axis

I have an object which can be rotated at 0, 90, 180, 270 degrees. I am using this to get the rotation data: transform.eulerAngles.x However that code keeps ...
user avatar
0 votes
1 answer
27 views

How do I revert back to "normal" speed after a slight boost hitting a collider mid-air?

How do I revert back to "normal" speed after a slight boost from hitting a collider mid-air? ...
user avatar
0 votes
0 answers
25 views

How to shoot raycast, and display image on canvas

I have been trying to work on raycast, where if a raycast hits an object then an image will be displayed on the canvas, like on COD Warzone if I go to an elevator shaft, and look at the wire to go up, ...
user avatar
0 votes
1 answer
46 views

How to pool bullets for a double barreled gun with alternating fire?

I have created the gun with two barrels, which fire in alternation. I have implemented pooling for one barrel, But I need to pool bullets in both barrels when firing in alternation. This is my Bullet....
user avatar
0 votes
0 answers
12 views

Why are my Ray Perception Sensors not detecting objects with the same tag and on the same layer

As you see in the image attached, the two road lines are identical in their properties (tags/layer, etc) and yet for some reason, the ray sensors are not detecting the road line on the left side of ...
user avatar
0 votes
1 answer
25 views

Exposing list of interfaces to inspector using Odin

Use case: scriptable objects that contain different algorithms but generate compatible data, which are used randomly in a procedural system. They implement an interface so that the system can give ...
user avatar
0 votes
1 answer
10 views

Getting text dimensions with TextGenerator.GetPreferredHeight/Width not working

I am using Unity 2021.3.3f1 and trying to make a pop up with a sprite as a background, where the size of this sprite adjusts to the size necessary to fit the text. From what I understand, ...
user avatar
  • 144
0 votes
0 answers
38 views

Why is my camera movement not Lerping correctly?

I am trying to move camera only on the x-axis based on a Swipe. I want it to move smoothly to the left or right. Right now, it seems to be simply be jumping a few pixels forward, and not Lerping at ...
user avatar
0 votes
1 answer
51 views

Custom world map chunks not loading correctly

...
user avatar
0 votes
0 answers
44 views

How to solve andriod build problem?

I downloaded Unity 2021.3.6f1 from Unity Hub for Windows and Android Build but Unity didn't download the gradle which is required for Android build so i download gradle 7.5 and linked it to unity but ...
user avatar
0 votes
0 answers
53 views

How to solve Unity Unexpected character

I am working on my project since morning , when i open my project later after work unity show me following error: Assets\Main\Script\SettingScript.cs(1,1): error CS1056: Unexpected character ' To ...
user avatar
0 votes
1 answer
77 views

Splitting large 3D world in additively-loaded Scenes vs using Addressable Prefabs or Bundles

I'm working on a 3D game with a large open world. It will naturally need to stream chunks. When you look at existing streaming solutions in the Asset Store, you can see that their approach is building ...
user avatar
  • 1,579
0 votes
1 answer
42 views

How to control post processing effects per-pixel with a render texture?

My game's protagonist is after a specific resource on the map, its concentration stored in a field on the CPU-side, and I would like to provide a subtle hint as to where it is so that the player can &...
user avatar
3 votes
2 answers
225 views

How to find vector representing altitude of a triangle?

I'm trying to find this green vector and I've got three points A, B, C. How can I find that vector in Unity code-wise?
user avatar
1 vote
1 answer
110 views

How to deal with insane amount of shader variants waiting to be compiled in Unity >= 2021.2 / URP >= 12?

Since Unity 2021.2.0b7 (that is, URP 12.0.0), there has been a well known problem with absurd number of shader variants wanting to be compiled for even a somewhat simple shader (i.e. shaders generated ...
user avatar
  • 76

1
2 3 4 5
307