Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take 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
44 views

Does changing multiple sprites on a single animation affect performance?

I have been building a 2D sprite-based game for which I want to have the player be able to customize their equipment. This means that although I am fine with drawing the content, I'd need to ensure ...
user avatar
  • 101
0 votes
0 answers
17 views

Variables set in script/Unity do not work in visual studio

I was just trying to set up an array through Unity when this happened. Basically, I set the array size and values through the Unity Inspector, however, it did not register in VS. I found this out when ...
user avatar
0 votes
0 answers
15 views

Multiple cameras PostProcessing render in a different order on iOS and Android

I have a setup below: Unity 2020.2.1f1 Post Processing Stack v2 (2.3.0), Color Grading with High Definition Range, Gamma Rendering Cinemachine Camera+Brain PostProcess (Depth 0) Cinemachine Camera+...
user avatar
  • 2,502
0 votes
1 answer
20 views

Unity VR IK Rig Accurate & Dynamic Proportions For Players

Hope all is well with you! I am messing around with a game idea in Unity. I am working on getting a good IK rig going on for the player since it will be an important part of the gameplay. I currently ...
user avatar
  • 3
0 votes
0 answers
25 views

Unity Oculus Quest 2 freeze when building

I wanted to export a project directly on a Oculus Quest 2, the project works well on PC with Oculus Rift and Quest 2 in air link but when I try to export it to the Quest device, It get stuck on "...
user avatar
  • 53
0 votes
1 answer
40 views

Setting a border around a unity 2d tile map

I've a procedurally generated hex tilemap, which is larger than the bounds of the screen (when not zoomed out). What I want to do is create a border around the tilemap. The tilemap is a child of a ...
user avatar
0 votes
0 answers
48 views

Pathfinding sprite disappears when approaching the player in Unity

I'm trying to make AI for enemies in my game. I applied a pathfinding (A*) script to my enemy sprite, after which the sprite began to follow the player. But when the enemy approaches the player, the ...
user avatar
0 votes
0 answers
27 views

Need help looking into IndexOutOfRange Exception for my Audio Manager script

basically, its as the title says. I am trying to build a brick breaker game in Unity2D, and I have found myself unable to play the death sound effect (played whenever a brick breaks). ...
user avatar
0 votes
0 answers
16 views

Possible to overwrite reference type without breaking references?

I'm trying to write a system for loading a bunch of variables from disk at runtime. For a Unity game. I'm using the Easy Save plugin to serialize a parameters class. I have a wrapper class that allows ...
user avatar
0 votes
0 answers
67 views

Plot rigidbody path simulating magnus effect

I am trying to create a method that will plot the path a rigidbody will take when simulating a magnus type effect with no gravity in Unity. I realize this approach is a drastic simplification to the ...
user avatar
0 votes
1 answer
48 views

Color glitch with tilemap.SetColor() in Unity

I've been experimenting with Tilemap to display tiles (with random colors) in script with SetColor() and other methods: ...
user avatar
  • 117
0 votes
1 answer
43 views

Game Data Files security in unity

I have some game data files in PDF, excel, and video format. Is there any way to make it secure? Through encryption? I have almost encrypted my all files in .aes encryption format but there is a huge ...
user avatar
1 vote
1 answer
27 views

Configurable Joint rotation doesn't seem to respect mass difference

The Problem I've run into a physics issue in my Unity project, and have put together a simple example scene to illustrate it. Hopefully someone will be able to tell me if I'm doing something wrong. In ...
user avatar
0 votes
0 answers
15 views

Orchestrating scene flows in Unity

New to Unity and I've now completed several of their basic tutorials (2D Ruby's Adventure and Create with Code) and am having trouble seeing the "forest through the trees" on my first toy ...
user avatar
0 votes
1 answer
18 views

Why do I still get values from _CameraDepthTexture even if I didn't set depthTextureMode?

I forgot to write this C# code to enable depth from my camera: ...
user avatar
0 votes
0 answers
34 views

How to increase the size of an empty object with a "Pathfinding" component in Unity 2D?

I'm trying to make Enemy AI for my Unity game. To do this, I watch this tutorial - https://www.youtube.com/watch?v=jvtFUfJ6CP8&t=1163s. The tutorial describes how to use this pathfinding - https://...
user avatar
0 votes
0 answers
37 views

saving and retreiving parameters from file dynamically

I am trying to write a system for saving and loading a bunch of parameters at runtime. I have a central class CentralParams that holds all the parameters. Each ...
user avatar
0 votes
1 answer
27 views

How to use OnDrop on non-UI elements?

I'm new to Unity and coding (C#), so sorry if this is a novice question. Is the OnDrop function only usable for UI elements? I am currently making an ARPG Card game ...
user avatar
0 votes
0 answers
12 views

How do I control drag speed of Unity's scroll view to make it slower than mouse drag?

I'm having an issue figuring out how to make the scroll move slower than very fast mouse drags/swipes. I've tried changing the scroll sensitivity, inertia deceleration rate, and the EventSystem's drag ...
user avatar
0 votes
2 answers
50 views

How does a "static" IEnumerator work in this context? (The code works, but what is it actually doing?)

I am generating many objects procedurally in my Unity C# app/game such as user interfaces, user profiles, etc. I have made classes which feature static variables/functions to allow this. Everything ...
user avatar
  • 197
0 votes
0 answers
18 views

Problems with creating Linear Guide using Configurable joint

I'm trying to create an Linear Guide mechanism using Configurable Joint (I think this joint is better than other for this situation). I connected an orange cube to another object (let's call it frame) ...
user avatar
0 votes
1 answer
86 views

Trying to get sprite from isometric "z as y" tilemap

I'm using code like the following with a tilemap and tilemap collider 2d: var ray = Physics2D.RaycastAll(worldCoordinate, Vector2.zero); Unfortunately, when I ...
user avatar
3 votes
1 answer
96 views

Unity CharacterController steps on colliders with 0 Step Offset

I'm moving my CharacterController with the Move() method and for some reason it still steps on colliders even though its Step ...
user avatar
  • 626
0 votes
1 answer
20 views

Player object changes position when I click the pause button [duplicate]

I have a simple mobile game where every time I touch the screen, the car changes direction. The thing is, I need to implement a pause button, but when I click pause I need the car to stay still and ...
user avatar
0 votes
2 answers
73 views

How to find words on a hex grid

I am trying to make a hex grid based word game. Currently the words are placed from a list of pre-defined words(a list of animals in this case). All colored cells make a word that was placed, while ...
user avatar
0 votes
1 answer
36 views

How to round to a multiple of 0.25? [duplicate]

I have a problem when I any rational number so that it's 0.25, 0.5, 0.75, etc. ...
user avatar
  • 507
0 votes
0 answers
6 views

Unpack prefab the way materials will be editable in Unity [duplicate]

I importing models from Blender to Unity just moving .blend file to assets. I want edit materials in imported models, mostly, just set smoothness to 0.5, because, this value being exported from ...
user avatar
0 votes
1 answer
19 views

Unity Multiplayer Sync Bools

I have a little problem with syncing booleans on my networking game. I use the Mirror-Package for networking and use KCP for transport. When the players basicly collide each other (using a sphere ...
user avatar
0 votes
1 answer
26 views

Can't make simple shader transparent in Unity

I have already visited a lot of links, but non of them did not help me. I just want to make a window as a plane (face) with texture with transparency. .shader: <...
user avatar
0 votes
1 answer
23 views

rendering the position of a mesh in a shader as a color, but the color does not match the actual position

...
user avatar
0 votes
0 answers
50 views

What is the best approach for achieving DI / testability in Unity development?

Sorry for the fairly open-ended question, but I'm hoping I can get some insight on how to tackle automated testing in Unity. I've been quite surprised to not find a "definitive" approach on ...
user avatar
0 votes
1 answer
32 views

How to keep gui button original color including the white content color?

This is just a test. The PING PONG button color is in Red and also the START/STOP button start with the Red color. but in the START/STOP button i'm trying to keep the original color and then to change ...
user avatar
0 votes
0 answers
14 views

Unity - Rigid Body Floats Away When Adding Ragdoll

I added a ragdoll component to my enemy model and now it just floats away whenever I run the game, this never happened before I added the ragdoll. if theres anything else I need to send just tell me ...
user avatar
0 votes
1 answer
24 views

VariablesSaver.cs is corrupted after project migration in newer Unity version

I updated Unity Editor version to 2021.3.0f1 from I do not remember which version where I had a project. After reimporting, almost all is fine, except 2 exceptions in console about syntaxis error in <...
user avatar
0 votes
0 answers
36 views

Event for inspector updates

Is there an event I can subscribe to from a static class that will trigger every time the inspector is changed, similar to OnValidate()? Or do I have to have a monobehaviour running to detect ...
user avatar
0 votes
1 answer
39 views

How to change GUI box background color for each gui button individual?

The problem is at this part, the color is changing the background also for the PAUSE button and not only for the PLAY/STOP button. Before i added this part the PAUSE button color changing was working ...
user avatar
0 votes
2 answers
38 views

Unity not able to find package listed in their own tutorial

Please note: I uploaded a Youtube video here that may help tie all my confusion together but I also explain the highlights below which forms the basis of my question. Unity here. I'm trying to follow ...
user avatar
0 votes
1 answer
31 views

Why when changing gui box color ith a color variable in the inspector in run time the color on a gui button is not the same?

When setting the color i'm not using the alpha because then it will not change the color at all and it will be transparent. in this line : ...
user avatar
3 votes
1 answer
145 views

Trunk Based Development: Prevent unreleased assets and features from being included in the build

Our team is currently working on a live service game (A game that will be updated regularly post-launch) and is using a trunk-based development strategy. The trunk-based development strategy is great. ...
user avatar
  • 33
0 votes
0 answers
27 views

Is there a performance difference between modeling a complete scene in Unity with assets vs importing a complete 3D scene from SketchUp?

I've worked with 3D modeling (architectural projects) using SketchUp for 4 years. I'm trying to import the models into Unity and then add the components I want (like colliders, scripts interacting ...
user avatar
  • 1
0 votes
0 answers
22 views

Keeping speeds of camera & mouse movements the same on drag in Unity

So, I am working with Unity's new input system and I have been able to set up movement on the camera so that the user drags the camera around with the middle mouse button. However, there is a parallax-...
user avatar
0 votes
0 answers
33 views

Suddenly getting pink rendered texture on model

Hey All I have been using this model in this project for a bit and everything was fine then suddenly this issue popped up and I am not sure what could be the cause. I am using a flatkit shader but ...
user avatar
  • 137
0 votes
1 answer
45 views

Can't add script behaviour Interactable. The script class can't be abstract!

I'm building a Raycast setup where game objects run code on click / touch. ...
user avatar
0 votes
0 answers
34 views

I'm using a *Floating* Capsule Collider, but it keeps contacting floor especially if I fall at high speeds?

I have the below code for a "Floating Capsule" style Rigidbody controller. Based largely on a tutorial (https://www.patreon.com/posts/astro-kat-moving-21343562) although I've modified it a ...
user avatar
  • 45
0 votes
0 answers
24 views

Why would a coroutine end early without an error?

I have an IEnumerator that triggers a collection of objects (the "troopers" in a unit; this is a hex-based wargame) to run up to target points and back. This works mostly fine (it's based on ...
user avatar
0 votes
1 answer
22 views

How to use pingpong in the waypoints script?

I tried this : And the pingPong is working but after some times changing the pingpong flag true false many times i'm getting index out of bound exception : The pingpong line that give the exception : <...
user avatar
0 votes
1 answer
22 views

Is there an alternative to Update for continuously spawning an object?

What I did here works, but it looks messy and funny to me. ...
user avatar
0 votes
2 answers
37 views

Is it possible to project a vector on another vector to calculate the distance without raycasting

I have the following game scenario: Player is P and there are 2 enemies E1 and E2 I want to calculate the distance between the ennemies and the player base which is anywhere in that green line, and ...
user avatar
0 votes
1 answer
22 views

Attach images via script into array unity

I have 3 objects of Image type in game scene. So I need to attach this 3 objects via script into Image array inside of this ...
user avatar
  • 3
0 votes
0 answers
21 views

Can write and read from a script on Firebase?

I want to post a script on Firebase and connect it with my game. It's possible to make my game write and read from that Firebase? When Player start a level, Load a script from Firebase. When Player ...
user avatar
  • 507