Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
0 votes
0 answers
10 views

Unity Grayscale camera but mask colors

I'm trying to replicate the example given in this thread: https://gamedev.stackexchange.com/a/185593/179264, and I was able to, but for now I want to implement the "mask" thing to 2d lights ...
crgd 23WD's user avatar
0 votes
0 answers
8 views

How to map different serverless logins (Facebook, Apple, Google Play) to one account in Unity CloudSave?

How can I map serverless different logins (Facebook, Apple, Google Play) to one Account in Unity CloudSave? Or is it automatically done when we are logging in via ...
Bogdan's user avatar
  • 143
1 vote
0 answers
33 views

How to make enemies navigate around each other in a grid-based game?

I am making a 2D top-down grid-based game where the movement is similar to older Pokémon games so it's locked to a grid. I implemented A* pathfinding for my enemies with a bool[,] that indicates ...
rossz97's user avatar
  • 11
0 votes
0 answers
24 views

What is the best lighting & shadow setup for mininal draw calls and triangles?

I have been testing out various lighting and shadow settings in Unity since during play mode the stats are showing a much higher set pass call and triangle count to what I know my model has. I have ...
FrontEnd's user avatar
  • 1,707
0 votes
1 answer
35 views

How do you make the camera not "Shake" when used with a rigidbody for 3D in Unity?

So I have no problem getting it to work with a characterController. It looks smooth when I walk/run/jump around. But I wanted to make it work with a rigidbody. There was no problem when I tried ...
MrV's user avatar
  • 1
0 votes
0 answers
24 views

Player-Environment Interaction & Collision Handling in Unity

Simply put, how would you go about designing environmental interactions? For example, upon pressing the interact button when near a chair, he can sit on it. (Also works with NPCs functioning with <...
NotLucifer's user avatar
0 votes
0 answers
47 views

Only 1 out of 3 Animator components react to trigger event

I have a main menu in which I want buttons to play an animation when they are held pressed and only fire it's "OnClick()" event when the animation ends. (So it's reset if you do not hold it ...
NationalGeographicProgrammer's user avatar
0 votes
1 answer
32 views

In Unity if you use Destroy on a GameObject and then immediately change the GameObject value, which GameObject gets destroyed?

Since Destroy happens after the update cycle, I wonder if you could accidentally (or intentionally) change what gets destroyed since you can still have code execute after calling Destroy. For instance,...
Ben Mora's user avatar
  • 437
0 votes
0 answers
9 views

How to fix UVs of spline tunnel/cylinder mesh?

I have created a tunnel using unity's spline tool. And I'm creating a custom shader for it in shader graph, and I would like to add bumps inside of the tunnel. The problem is in how the UVs, vertices ...
kyopa's user avatar
  • 131
0 votes
1 answer
46 views

Call to Random.Range() is breaking my prefab instantiation

This is for a simple sidescrolling game. I want to have it so that when an enemy is killed, it has a chance of dropping a health collectible for the player. I wrote a separate simple bool method ...
Dan Shaw's user avatar
1 vote
0 answers
16 views

Unity Animation Rigging Override Transform is not affecting rotation on startup

Given: I have animation of character arming the pistol using IK. The pistol In Character's Idle State is on the characters hip and it's barrel is looking at the floor. Next I have armed state when ...
Taras Fityo's user avatar
1 vote
1 answer
63 views

Rotating around Wall Corners while Climbing

So I've posted here before regarding a Spider-Man like game that I'm working on. I'm facing another dilemma now. I want to rotate the player around the edges of walls. So far, I've implemented a ...
Abeer Mustafa PC's user avatar
0 votes
1 answer
14 views

Selection Box Not Positioning Correctly

I found some code that generates a selection box, but when I tried it the box was not starting where the mouse was and I couldn't find the issue. ...
PizzaLvr49's user avatar
0 votes
1 answer
24 views

Trouble with NetworkDriver.Create in Unity Networking

I'm encountering an issue while using the NetworkDriver.Create method in Unity Networking and I could use some assistance. Here's the code snippet where I'm facing ...
Navid's user avatar
  • 3
0 votes
2 answers
52 views

Getting the Player to Face Movement Input on the Z-axis

I'm working on a Spider-Man like game and I've run into a problem. Whenever I'm near a wall and press the w key, the player starts climbing the wall. But when on the wall, I want it to face the ...
Abeer Mustafa PC's user avatar
-2 votes
0 answers
38 views

How do I control the rendering of each sub-pixel in each frame in unity

I now want to compose an image where the sub-pixel values come from a different render texture. How do I control the sub-pixel composition for each pixel point in shader?
BrianYe99's user avatar
0 votes
0 answers
16 views

How to update a component field for a single player for all player views?

I'm making a 2 player game in which, when 2 players are in a room, they "toss a coin" to decide which of the two player "skins" they get. Now, the way I built the player "...
Kaiannae's user avatar
  • 113
1 vote
3 answers
67 views

Unity/URP global volume with volume mask still applies effects to all layers

I simply would like to apply the Global Volume only on specific layers but I probably misunderstood how it works. Environment & Inspectors GameObject\ ...
Baro's user avatar
  • 81
2 votes
2 answers
34 views

How to ensure smooth animation when making spline longer?

In Unity, I have a Spline that I'm using to move an object. During the game, the player can add new knots to this Spline as the object moves forward. e.g if they want the object to go right, they can ...
kyopa's user avatar
  • 131
0 votes
0 answers
12 views

How to use a key to stop playing the current animation, and replay it from the beginning?

In my Unity project, I tried to use a key to stop the current animation and immediately play it from the beginning again. I also tried to control the delay before I can press again. The following ...
URORU's user avatar
  • 1
0 votes
2 answers
46 views

Can you somehow use underscore to ignore different results in Unity like you would do with TryParse?

So I may not be the best programmer, but I am not a beginner. So in C# when you want to check if... lets say if its a number or not, but you dont care about the result(the you could write something ...
MrV's user avatar
  • 1
0 votes
1 answer
46 views

How to create an infinitely long tunnel that a player is flying inside of, while letting them control the path the tunnel takes?

I'm trying to create a game where the player is flying in an infinite tunnel in first person and they can control the tunnel's path in real-time. e.g if they press D, then the tunnel should turn to ...
kyopa's user avatar
  • 131
0 votes
0 answers
26 views

2D Physics inconsistent across platforms

I want to create a black hole like gravity pull effect in Unity2D, and used that code for this: ...
CheckerT's user avatar
0 votes
1 answer
30 views

Null reference exception when adding bodies to a list

So, for conversational clarity/brevity, I have 3 sphere gameobjects, each with their own Rigidbody component. They all have a tag of 'body'. The 3 spheres have progressively larger masses. body1 mass:...
Skittles's user avatar
  • 103
0 votes
0 answers
22 views

How can I use `UnityEngine.UIElements.PopupWindow` for a custom PropertyDrawer targeting an array with UI Toolkit?

I'm following the "Create a Custom Inspector" car and tire example that Unity has in their documentation for UI Toolkit, but I'm trying to modify it in a specific way and I'm coming up short ...
NJJ_002's user avatar
  • 47
0 votes
0 answers
39 views

How to make smooth movement for a tunnel traveling music game?

I'm creating a music game where the player travels inside a tunnel and can create twists and turns while listening to music. Here's a video showing what it currently looks like. I'm looking for advice ...
curiousCprogrammer1231's user avatar
1 vote
1 answer
79 views

how to to make a camera like scooby-doo game

I'm trying to make a camera like scooby-doo game. Example: https://youtu.be/mkxm7-uw_uc?si=VpywD2wHJGAChw9N&t=238 It seems to be a 3rd person camera but its not always attached to the player. Its ...
anderlaini's user avatar
2 votes
1 answer
57 views

Cannot read value of type 'Vector2' from WASD KeyControl

I'm getting these error messages when I try to use Unity's new Input System package: Cannot read value of type 'Vector2' from control '/Keyboard/w' bound to action 'CharacterControls/Movement[/...
Fenrir's user avatar
  • 21
2 votes
2 answers
55 views

How would I make minimap of racing track where dot follows track progress in Unity?

I would like to show race progress in my UI. My minimap is like sketch below: Blue dot represents progress and red dot is finish line. I would like this to work in UI so only blue dot would move. If ...
Ivan's user avatar
  • 337
0 votes
0 answers
21 views

Is Unity Legacy/Diffuse shader almost as efficient as Mobile/Diffuse shader (for mobile apps)?

I am developing mobile apps. I know that Mobile shaders are the best options for mobile apps in terms of fast performance. However, I purchased 1 Unity asset, which only works with Legacy/Diffuse ...
Job_September_2020's user avatar
0 votes
1 answer
32 views

I am having error CS2012 when trying to run my visual studio code in unity (i am new to this)

I made my first script in Visual Studio and saved it to Unity, however, i get this error: The requested operation cannot be performed on a file with a user-mapped section open. This is my code: ...
caiamari's user avatar
1 vote
1 answer
55 views

Post Processing Bloom for mobile

I have recently asked a question where I wanted to know why Post Processing effects lag so much on mobile. As I know now, it has to do with limited performance on mobile end devices. So, I am asking ...
CheckerT's user avatar
0 votes
1 answer
71 views

Checking combat on the server to prevent cheating - how to keep two codebases in sync?

I'm making an idle game with semi-multiplayer. My game uses Unity as a client and as a server Unity Gaming Services (UGS) C# Cloud Code Modules with UGS Cloud Save, this server is non-persistent, ...
Pascal Claes's user avatar
0 votes
2 answers
108 views

Unity Navball x,y,z rotation axis' are not tracking main object

I am trying to figure out how to solve this issue. My navball is tracking the ship's rotation incorrectly as shown in the image. When the ship rolls (Z Axis) to the right, the navball rotates down on ...
Skittles's user avatar
  • 103
0 votes
0 answers
15 views

BehaviourDesigner Runtime Squads for new Formations

I'm struggling to make a new "Squad" at runtime from group selection to move in BehaviourDesigners Formations. The code for what I've done but this would turn this question into a novel, so.....
akaBase's user avatar
  • 121
9 votes
3 answers
3k views

What is Unity's definition of time?

So I've been messing with both Avelog's Mouse Simulator and GameGuardian. Mostly out of fun, but partially out of finding weird game quarks that might be useful in a speedrun. I'm going to be writing ...
qwerty keyboard's user avatar
0 votes
0 answers
33 views

How can I either adjust or create custom text anchors for property attributes?

Following up on a previous question about aligning HeaderAttributes, I've been attempting to slightly offset my own custom header attribute so that it's either to ...
NJJ_002's user avatar
  • 47
0 votes
1 answer
34 views

How can I center-align a HeaderAttribute in a Unity custom inspector / can it be done simply?

So far, this is the only resource I've found that does what I'm looking to do (which is to center-align my inspector headers): CreatureSurvive's example script on GitHub Gist If I'm understanding ...
NJJ_002's user avatar
  • 47
0 votes
1 answer
63 views

Unity: Cannot access TMP_Text object from script in gameobject

I'm trying to set the color property of a TMP_Text object but keep getting Object reference not set to instance of an object error. Setup is as follows; I have a ...
Skittles's user avatar
  • 103
0 votes
1 answer
22 views

Is there any documentation for `EditorGUILayout.Separator()` / what does it do?

I'm experimenting with custom editors, and stumbled upon EditorGUILayout.Separator() while trying to figure out how to draw a line near the top of my inspector ...
NJJ_002's user avatar
  • 47
0 votes
1 answer
33 views

What are some basic methods/algorithms for drawing wireframe shapes using Gizmos?

This is definitely a "doing for the sake of learning" question, so apologies in advance for that, but how would you go about using the Gizmos class to draw a basic wireframe shape? I'm ...
NJJ_002's user avatar
  • 47
1 vote
0 answers
32 views

My shadergraph animation gets extremely faster during in the actual game compared to the editor

Currently I'm using a shadergraph for an animated material, for some reason as long as I don't have any input it works as intended and with the correct speed, while if I do any action/input the ...
Seo's user avatar
  • 11
0 votes
0 answers
17 views

How can I do the UI mask effect on a URP decal?

How can I do the UI mask effect on a URP decal?
Diego Morales's user avatar
-1 votes
1 answer
66 views

How to make a 2D Procedural Track Generation Algorithm

I would like to create an algorithm that generates a random track that a car can race on. How would I best go about such an algorithm? I will be using Unity 2D, but for my project I require using an ...
Techwizard's user avatar
0 votes
0 answers
27 views

Efficient Methods for Creating Moving Frontline Animation in Unity

What is a better way to create moving frontline animation in Unity? Hi, I'm new in the Unity and I'm interested to create a moving frontline map animation for a strategy game. Here is what I want to ...
Tomoaki's user avatar
0 votes
0 answers
17 views

Is there a way to convert assets based on a ScriptableObject to another ScriptableObject type?

Is there a reasonably practical way to convert assets based on a ScriptableObject to another ScriptableObject type (that are not part of the same OOP hierarchy) without breaking references to the ...
Saturn's user avatar
  • 1,771
0 votes
0 answers
14 views

Can I extract/bake the collisions generated by a tilemap collider?

Given a tilemap, with a tilemap collider, is it possible to extract/bake the current collision(s) onto a separate gameobject independent from the tilemap/tilemap collider? My 2D game streams a large ...
Saturn's user avatar
  • 1,771
0 votes
0 answers
37 views

Post Processing Bloom effects performance

I want to create Post Processing effects with Unity Post Processing Stack. I have found this post from this website Unity post processing Bloom lags on mobile, but it had no answers. I have exactly ...
CheckerT's user avatar
0 votes
1 answer
50 views

How can I make a camera follow an instantiated object at runtime?

I have an object meant to represent a player that I'd like to spawn in at runtime. Because it is instantiated at runtime, I'm not sure about how to get the main camera in my scene to follow the ...
NJJ_002's user avatar
  • 47
1 vote
1 answer
35 views

Values set in Inspector for prefab reset after restarting Unity

I am creating a prefab for a stylized input, which proxies properties to the underlying game objects that make up the input parts. (Using NovaUI for some parts) Here is my script for the ...
e-e's user avatar
  • 111

1
2 3 4 5
329