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.
16,744 questions
0
votes
2
answers
87
views
UI tween animation completely different on Phone and in Unity Editor
I have this function that spawns an Icon from a world position and animates it to correct UI position. In editor it works fine but in apk on phone it has a wrong starting position. Now as I understand ...
0
votes
0
answers
80
views
How to use model scale setting when importing into Unity?
Here is the screenshot of a model I downloaded over. In the import settings inspector you can see (my interpretation — correct me if I am wrong please):
Unity detects that its scale is in millimeters....
-1
votes
1
answer
81
views
How to match UI text size and position between editor and build?
In the editor, it does not matter if I set the resolution in the game view to my pc resolution (1920x1080) or to "Free Aspect".
The only thing that changes is that in "Free Aspect",...
1
vote
0
answers
42
views
attaching meshes to a character model with armature from Blender in Unity
I made a character model with a rig for my game in Unity. The model itself is fine both in Blender and Unity. I decided to add customization of the character's clothing, which means that I need to ...
1
vote
1
answer
111
views
Adjusting movement vector for converting to input vector in an isometric game
I am currently modding in keyboard and mouse support for a Unity game that only supports controllers. The game is in an isometric style, and as such, the game camera is slightly tilted. The original ...
0
votes
0
answers
47
views
USD File missing Materails in Unity
I have imported NVDIA USD File assets in Unity and for this use the Importer by Unity (com.unity.importer.usd). It successfully showed the USD file in the scene as object but the problem is material ...
0
votes
2
answers
121
views
Camera Snapping instead of panning
I am trying to make a camera system for a 2D platformer, with three camera modes to begin with:
Follow, normally following the player
Horizontal: Y is set, X follows player
Static: Locked to a certain ...
1
vote
0
answers
46
views
What is the best way to move a mask in a shader in a square path in Unity Shader Graph?
I would like to make the square move strictly along a square trajectory. The square will later be used to mask the main sprite.
How to achieve this result? How to move the square along the square's ...
0
votes
2
answers
135
views
My default animation state is stuck on little progress
I'm following CodeMonkeys 'Learn Unity Beginner/Intermediate' and I'm at the animation section. i tried doing it myself after watching it and I am pretty sure I did all the steps. But I reached the ...
0
votes
0
answers
64
views
Need a Hand with Liquid Shader in Unity (for VR Bartending Game)
I’m working on a liquid shader in Unity and could really use some help making it look more realistic. I’m going for that nice touch of transparency, reflections, maybe a hint of refraction—just ...
0
votes
0
answers
71
views
How do I use Addressables AssetReference RuntimeKey to compare the loaded assets with the AssetReference
I will use Addressables to load multiple assets of type Bag that share the same AssetLabelReference.
So I will load them using ...
0
votes
1
answer
231
views
How to position health bars above units in Unity regardless of camera location, angle and zoom?
Here is what I want to achieve, health bars that stay perfectly above the units, regardless of where the unit moves or where the camera is: https://www.youtube.com/live/fZSaPDz-GJc?si=B868wwF5KAPCuEtw&...
0
votes
0
answers
73
views
Even though I increased the detail distance, why is the detail object not visible when the camera moves away?
I bought an asset and it had wheat assets in it and I wanted to use it to plant in the field in my game, but they are not visible when the camera moves a certain distance away. There is no change even ...
0
votes
1
answer
97
views
Detail Distance and Tree Distance Not Working Correctly
I just started using Unity 6. Today I created a terrain for my game. My terrain also has details and trees. When I change the distance in the terrain settings, nothing changes. The default setting is ...
0
votes
1
answer
148
views
Modular Pathfinding Between Connections
I'm creating a puzzle for my game, where you have to arrange pipes to transmit an electrical flow from one point to the other. Each pipe center contains a connector hub and each end contains the ...
0
votes
0
answers
33
views
Mobile Input for android build
I want to make buttons for a mobile build, testing with android 11. To set variables, which I read in other scripts, I use the following code:
...
1
vote
2
answers
520
views
How do I implement the "collide and slide" algorithm in Unity?
I've recently been attempting (and failing) to create my own character controller for my 3D Unity game for around a week. I hate the Unity rigidbody physics system for making a character controller, ...
0
votes
1
answer
104
views
Why isn't my object following the target?
I don't understand why my object does not follow the player. I instantiate the character with the PlayerPrefs I saved from another scene. However, the object tracking code does not follow, and also ...
1
vote
1
answer
67
views
CapsuleCollider2D hitbox fails to trigger when player/enemy are stationary
I'm currently working on my first game in Unity, and I'm having some trouble with attacking. Currently, I have a game object with a 2D capsule collider child. When the attack button is pressed, the ...
1
vote
0
answers
52
views
Reserved Memory Keep Increasing When Loading the Same GameObject Using Unity Addressables
I'm trying to learn how to use Addressables in Unity to improve memory usage, but there's something I don't understand.
I use ...
0
votes
1
answer
56
views
Navmesh Agent unable to cross doorway?
I am facing a strange issue where the navmesh agent is unable to cross a doorway. It used to work earlier but now suddenly it does not anymore. I am unable to find any possible colliders or objects ...
0
votes
1
answer
125
views
How to instantly stop when moving the character with AddForce?
I made character movement using AddForce. But I don't understand how to get the desired effect. I need that when I release a movement key (for example WASD) the ...
1
vote
1
answer
195
views
How can I make liquid in my vr bartending game
I'm working on a realistic VR bartending game for Quest, and I need some help with making bottles pour liquid into cups. I'm aiming for a system where:
When a bottle is tilted, liquid pours out ...
0
votes
0
answers
31
views
Bug Canvas image being stuttered when move follow player?
I tried to code an image to follow the character using canvas but it jerks when moving. Is this a bug? Do you have any solution to fix it?
https://youtu.be/OnT9Pabgi2g
...
1
vote
0
answers
156
views
How to conserve momentum in Unity?
I tend to use a lot of 2D physics based (rigid-body based) character movement in Unity, and despite lots of tweaking, I can never seem to use conservation of momentum.
I’d have to manually program in ...
1
vote
1
answer
129
views
Two Point Alignment Transformations
I'm trying to determine the transformation steps (position, scale, rotation) needed to be applied to an object so that two points, locally positioned in that object, line up with two world space ...
0
votes
0
answers
70
views
How to disable lobby/relay for a project in Unity?
Me and a friend created a basic multiplayer game in Unity using Netcode For GameObjects. We also used Lobby and Relay Gaming Services to make it easier to play with each other.
There is only one ...
0
votes
2
answers
138
views
How to highlight only specific part of the UI image in Unity?
How can I highlight only specific parts of an image in Unity?
My image would be something like the example below: a grid with text and fields. Text can be separated, but I would prefer it be part of ...
3
votes
0
answers
244
views
How to make a Docker build for a Unity dedicated server?
According to my searching, there is no clear best practice for it.
What I tested that worked for me was making a Linux dedicated server build and dockerizing the build. The problem is that it's a two-...
4
votes
3
answers
3k
views
How to avoid cycles when one character stat can be enhanced by another?
I am creating an ability system in Unity and it is currently able to update base values of stats and keep track of persistent buffs/debuffs while taking operation order into account (Add, Increase, ...
0
votes
1
answer
157
views
Are Unity's default assets shipped with the project when built, even if they are unused?
A typical Unity project comes with some default assets. For example, look at these 2D sprites:
The Square asset is the default Sprite that gets applied to a ...
0
votes
1
answer
126
views
Color is different in Scene vs Game View
This is a new project I just started, so it has no scripts or assets attached to it. As the picture shows the scene view and game view have a different colors. I don't know what I should change, since ...
0
votes
1
answer
93
views
Unity shader optimization
I have a problem with badly optimized palette cycling function of the background shader:
...
0
votes
0
answers
45
views
Trouble aligning A* project dimetric grid with Unity 2022 LTS isometrig tile grid
I'm trying to use the A* path-finding project by Aron Granberg (free version 4.2.17) to do path-finding on an isometric grid (32x16 pixels). I have the whole system functional, but can't for the life ...
0
votes
1
answer
100
views
Lerping Time.timeScale causes laggy physics
I am using unity as my game development platform. I was trying to create script that could interpolate time scale to achieve a flurry rush.
The code below is my attempt:
...
1
vote
2
answers
143
views
Change the tile in the tile map at runtime
So I am making a game which has a farm. The farm is a tile map with each individual tile being a crop/mud.
I want to achieve the following
As the player interacts with a particular crop tile, I change ...
0
votes
1
answer
85
views
Unity object becomes missing after changing the scene and to different scene and returning to the first scene again
I am developing a tool in unity that requires some objects from the active scene, and currently, I am working on a system to save the data so that the user does not have to enter it manually each time....
0
votes
1
answer
67
views
UI Toolkit px size different from the game view
I set my game viewport to QHD and my UI Builder viewport to match game view. Yet in my UI Builder the window is nicely scaled within bounds, and in game view it is waaay too big. How can I make them ...
-1
votes
1
answer
354
views
Should I use Unity 5 or Unity 6? [closed]
I have been working on character drawing for a long time and Unity 6 is also relatively new. I am using the 2020 Unity5 version. The game I will make will not be a very advanced game. I will do ...
1
vote
1
answer
166
views
How can I fix the rotation on a sprite normal map in Unity?
I'm making a 2D ball game in Unity v6.0, now in the process of adding some 2D lighting.
The player ball is a circle sprite. To make it look like a sphere, the sprite has a normal map added as a ...
0
votes
0
answers
65
views
How to code marking dead stones in Go board game. Getting user input outside of update
This is a follow-up question to coding capturing in Go. I have that successfully working. I am pretty sure that I am not reposting, this is a completely different question I have it just happens to be ...
1
vote
3
answers
279
views
Is it possible to set a specific frame rate on my game
For the past month i've been working on a vr project and i wonder if i can obliged players to be on 90hz when playing the game because if player use 60hz then the game becomes laggy and since 90hz is ...
1
vote
2
answers
198
views
How can I play hundreds of characters at the same time on stage without dropping FPS?
I will make a game. In this game, the player will make 6 soldiers from 6 different looking characters in his own area and there should be this many characters on the other side. When I look at those ...
0
votes
1
answer
158
views
How do you detect edges in a PNG map
so basically i'm making a personal project based around a strategy map game.
I'm using this image as the map:
The problems are as follows:
I can't detect the borders as it is not an SVG
If the first ...
7
votes
3
answers
4k
views
Is it possible to directly check for source code modification
I'm looking for a better way to actually detect "cheats" by checking if the source code of my game has been modified and if any code has been injected to the original code in C#.
The issue ...
0
votes
0
answers
72
views
How do you make unity shader with custom lighting usable in deferred rendering mode
I found a unity shader with custom lighting method that approximates subsurface scattering effect. I tried using it in deferred rendering mode and unfortunately it doesn't work. From what I have read ...
0
votes
0
answers
51
views
How to change colours of UI in Unity using Animation?
I'm making UI that's using controller support, and therefore I have to script it and use an Animation, but how do I make sure that a color change when hovering over a button happens instantly, because ...
0
votes
1
answer
131
views
Null reference exception when accessing ActionMap stored in a singleton
I'm a beginner developer and I'm currently working on a 3D game project with a third person view.
When I implemented my first ActionMap into my character controller,...
0
votes
0
answers
120
views
VFX Graph: Particle Strip Trails Stretching Due to Reused Indices – How to Set Unique Strip Index?
I have a system in Unity’s VFX Graph where:
A source particle collides → triggers a GPU Event
This event spawns a new particle which also triggers a strip trail
I am trying to get one trail per ...
0
votes
0
answers
62
views
Same prefab appears very different inside another parent
I am on Unity 6.
I have 2 prefabs: the buildings shown in this picture.
Each of these prefabs includes another prefab, which is the "hexagonal tile".
It's the same "hexagonal tile"...