The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0answers
8 views

How should I load/change/activate scenes?

Scenes are confusing the hell out of me and I'm pretty sure they should be simple to understand. When the game loads, only the current scene has a buildIndex != -1. In order give it a 'real' build ...
0
votes
0answers
8 views

Unity - Apply different Near/Far clip plane value for different layer

I am Lerping the Near value of my camera, from 0 to 38, and it give this result: change near clip plane effect As you see, it give a nice effect. But Now I would like the effect to occur only for one ...
0
votes
1answer
10 views

How do I make an object look at an angle in a top-down persepective?

Given a top-down persepective and lets say I know the angle I want to look at, how do I make a gameobject look into that angle? I currently have code like this: ...
0
votes
0answers
7 views

vector image is pixelates in game view

i imported .PNG file in 1920 X 1080 Res but it is Pixelates in game view and also tried as .SVG file but it also gives same result how to solve it...Help please
0
votes
0answers
5 views

Unexpected scaling of UI elements after build [Unity Web]

I have an unusual scaling of UI Elements after my build in unity for WebGL Game in Unity Engine: Game in Itch.io: Has anyone seen this kind of behaviour? any suggestions on what I should look into? ...
-2
votes
2answers
25 views

Want to stop instantiating objects when timescale is set to zero

I have my enemies being instantiated from both left and right sides and I've used Time.timescale=0; for the pause menu script so whenever i pause my game everything stop other than the instantiating ...
0
votes
0answers
24 views

How to erase the small gaps in tilemap in Unity?

I want to erase small gaps in my tilemap. The gaps look like this: The texture I used has no gaps: I tried by disabling anti aliasing.It didn't worked so what can I do in this case?
1
vote
0answers
18 views

Inconsistent CapsuleCast/Collision behavior when a GameObject is selected

My gameobject has a CapsuleCollider and I use CapsuleCast to check for horizontal collisions when moving horizontally so the gameobject won't pass thru obstacles. It works 100% of the time except ...
0
votes
1answer
33 views

unity manipulating sprite shape rendered

I wish to create a game object where you can start dragging it by touching somewhere on the line of its collision and to create these "dynamic shapes" by stretching the sprites and readjusting the ...
1
vote
1answer
20 views

Load scenes inactive

When I call SceneManager.LoadScene() it will set the loaded scene as active. Can I load scenes at the game startup and just call ...
0
votes
1answer
25 views

Unity - character is not moving

What I'm trying to do I have a character - prefab. For this prefab I have one animation (idle), which works fine - I hit "Play" button and my character is in idle state. What I want is to try to move ...
2
votes
1answer
60 views

Selected enemy off camera

I'm facing a problem with a game I'm making. Currently I can select an enemy and mark it as shown on the image: But now I want to show the position of the selected enemy on the screen when it's off ...
2
votes
1answer
100 views

Is there a way to customize the Game-view Editor GUI?

I need to add a simple slider like scale slider in Game-view to change the timescale because I usually test my games by changing timescale.
0
votes
1answer
36 views

Detect collision on explosion

I am creating spells for my game. The collision with a normal fireball works just fine, what I am trying to achieve is to have the player_2 getting hit when the ...
2
votes
1answer
35 views

Why does the object rotate to a random direction when I start dragging?

I'm trying to do drag to rotate sort of thing, so far the code is fine. However when starting to drag (left clicking first), the object rotate to a random direction first which looks odd. here is my ...
0
votes
1answer
92 views
+50

Creating 3D water on Unity for iOS/Android

I want to render an ocean where players can change waves’ amplitude in real-time. Initially, I would render rolling waves (see picture). As the amplitude increases, I need to transition the rolling ...
0
votes
1answer
26 views

How to get position of next object that closest to player,when player is move forward to nearest every time?

I have a scene that looks like the following picture: The Player has a RigidBody2D and all the ...
0
votes
0answers
10 views

Do I have to write #pragma multi_compile_fwdbase in ShadeLab?

Recently I met a problem that if I don't write #pragma multi_compile_fwdbase then the shadows will never be shown. However, if I don't want shadows, it's ok without ...
0
votes
0answers
14 views

Blender-Unity (+ Lightmaps): Can I (should I?) have multiple UV maps for a single mesh?

I am making a game that I worry is not running optimally due to lots of high-res textures. The irony is that most scene assets use the same materials but I have to (do I?) unwrap the entire mesh on a ...
0
votes
1answer
46 views

Unity: White outline around seams in my character, make it stop!

so once upon a time I made a really cool character for my game project and he looked great. Then at some unspecific point in time, my character's UV seams got these awful white outlines around them: ...
0
votes
0answers
20 views

2D Rigidbody with Touchscript movement in Unity won't stay in boundaries

I'm trying to make a pong game where the player has to move both paddles. They are currently set as dynamic 2D Rigidbodies (collision detection continuous) and have a box collider (is NOT trigger) ...
0
votes
0answers
5 views

Set Unity to Fixed oculus sdk for testing

guys, I have been doing some VR development and I have noticed there are often times I want to test if something that relies on the Avatar is in or working but I only have a standing rift right now ...
0
votes
1answer
7 views

apk is fine, but when building aab for google play submission google play services dont start when i download it

So I have a game on app store, I added Google play services Now when I do an apk build and test it works great really happy with it. But when I then tick the box for aab ( this is what Google store ...
2
votes
1answer
49 views

How to figure out what's moving my GameObject?

I have a GameObject as part of a complex scene with a handful of interconnected parts, that's moving when it shouldn't be. I've tried running under the debugger and setting breakpoints on all of the ...
-1
votes
1answer
44 views

unity check color on collision Enter2d

So I am trying to figure out how to check the color of my sprite on collision 2d. I change my colors of sprites like this: ...
2
votes
1answer
29 views

How to render line renderer or trail renderer above UI canvas

I want to create a line renderer and also trail renderer that would follow touches but both must be rendered above my UI canvas — how can I do this? I have tried this with the "screen space camera" ...
0
votes
1answer
17 views

I want to clamp each instance of the same prefab to the y axis only

I instantiated the prefab "paddle" twice then I tried clamping it to the y-axis only; using Mathf.Clamp, however, the min and max values end up being applied to both instances of "paddle" and hence ...
1
vote
1answer
43 views

Instantiate creates a clone in wrong position

I have this prefab with this transform: And then using this code to create a clone (the prefab is assigned to a public property of a script, which I assign using the editor, which is the e.Weapon): <...
0
votes
1answer
23 views

Move a ball horizontally left and right but restricting forwards and backwards motion unity 2d

I am trying to develop an endless runner where there is a sphere as the player and it is moving left and right following the position of a finger on a touch screen. However, when I try to do this I ...
4
votes
1answer
93 views

How to setup a public github unity repo with paid assets?

From what I gathered (like in this thread or here) I am allowed to push my own game code on github and choose a license, as long as I avoid putting assets I do not own. I want to make it public to be ...
0
votes
0answers
31 views

Combining rotation (using Quaternion* Quaternion) doesn't work as expected [duplicate]

I have fragment of code that has to rotate the camera to the direction where my cursor is as below: float yaw = mouseSensitivity.x * Input.GetAxis("Mouse X"); float pitch = mouseSensitivity.y * -...
0
votes
1answer
29 views

Unity “Text Mesh Pro UGUI” component rewrites my text! Make it stop?

I'm having this terribly annoying problem where my text is being overwritten by Unity. This Happens regardless of whether I am using tags or not. Here is what I want to appear (more or less, I don't ...
0
votes
0answers
19 views

Prevent Object Detachment from Hand when Controller Trigger is Released in Unity SteamVR

I'm using SteamVR's Player Prefab for Unity. For picking up objects I'm using the Throwable script which uses the controller trigger to pick it up and its release to throw. Is there a way to prevent ...
0
votes
0answers
22 views

Blurred sprite in Scene view

The thread between the tree and the spider here is a LineRenderer. When the BackgroundLandscape or the ...
1
vote
1answer
66 views

Unity - Level complete progress bar stops at 75%

I am trying to build a progress bar that indicates the completion of the current level from 0 to 100% (or from 0 to 1 in probability). I found this example: https://stackoverflow.com/questions/...
2
votes
1answer
41 views

Should a beta version of an engine be used to start a new project?

Is it advisable to use a beta version of unity(2019.3b) to make an actual complete project? What are the disadvantages?
0
votes
0answers
8 views

Unity - Standard grid projector not working

I am trying to figure out the grid projector in Unity but I cant get it to work, I want a simple square grid. Am I missing something? I tried several materials, rotations, settings etc. But all I get ...
0
votes
1answer
24 views

Standard Unlit shader doesn't work?

I created a project to download and try out free Unity assets. I then transfer the assets I actually want to use to my actual project which uses the LWRP render pipline. I tried to get some particle ...
0
votes
0answers
13 views

How to multi-thread arrays in Unity3D?

I have a 2D graph which takes a long time to process. The code processes all the horizontal lines in a loop as small workloads, and adds the lines to a big 2D array. I don't know how to do the ...
0
votes
0answers
18 views

Unity light probes are giving incorrect results

I've got a scene with a track. I've created a script that places light probes along the track to create a volume extending either side. However, as the vehicle moves along the track, incorrect ...
0
votes
1answer
22 views

Unity 2D Rotating Cannon to Mouse Position Inaccuracy Issue

I am trying to rotate a 2D cannon to clicked mouse position and having accuracy issue. It's working but the angle seems to be losing more and more accuracy when I move the mouse to further up or down ...
1
vote
1answer
31 views

How to seamlessly handle multiple procedural 2D levels in Unity3D?

I have a dungeon generating algorithm, but I would like to generate X levels, which are all connected somehow. I have a few approaches, but all of them has problems and questions, and I wonder how i....
0
votes
2answers
66 views

can i show logs in unity with different colors or different icon signs?

I'm working on a project that has a lot of logging messages that pass very fast. I can use error logs or warning logs but is there any way to log something with different colors so it is easier to ...
0
votes
1answer
30 views

SpriteRenderer not Rendering Sprite

Edit: I've slightly edited this question because I've found the symptom for my problem, but not why the actions I've noticed cause the issue. I have what appears (via the inspector) to be two ...
0
votes
1answer
18 views

Pausing animation and resuming on same frame

How do you stop an animation and then resume on the same frame where you paused? I tried: if (paused) { anim.speed = 0; } else { anim.speed = 1; } Sure, ...
0
votes
1answer
29 views

Unity Items not being removed from list

So I finally perfected my RTS multiple movement. The situation is that the game objects are added into a list in a script bound to the camera called UnitController ...
0
votes
0answers
12 views

Unity Animator - bool transitions keep re-entering state while true

My StateMachine is triggered in a loop as long as transition boolean is true. I have made sure my code only runs once, where I set the animation bool: ...
0
votes
0answers
21 views

Running Unity Build through Command line

I recently developed a game in unity and would like to build it to a standalone application using the command line. Is there a way to do that? Specifically, without opening the Unity Editor how can ...
1
vote
1answer
53 views

Prevent weapon from clipping during animations

I am trying my ways with Unity 3d animations, and so far so good. The only problem is, when I equip an weapon in the player model's hand, the weapon clip through player's head during some frames of ...
6
votes
1answer
257 views

What is the best way to remove a list reference after the object has been deleted at edit time?

Inside a MonoBehaviour MyComponentA I have a list of MyComponentB (also a MonoBehaviour) like so: ...