Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
12 views

vector image is pixelates in game view

I imported a .PNG file at 1920 X 1080 resolution but it is pixelated in game view. I also tried as a .SVG file but it also gives same result. How can I fix it?
0
votes
1answer
36 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
2answers
6k views

How to change the pivot in Unity

I have a cube created in Unity scaled 5 times. The pivot of the cube is by default in center. I would like to change the pivot to the one of the vertices. How to do that ?
0
votes
1answer
34 views

Rendering Problems(Artifacts, Flickering) with the Mirage Solo VR Headset

Im getting some strange flickering artifacts when testing on device (Mirage solo), this problem occurs on Unity 2018.3.2 and Unity 2019.1.2. Its not happening on other devices such as the OculusGo, ...
0
votes
1answer
26 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: ...
3
votes
3answers
4k views

“Your license does not cover Android Publishing” error

I recently installed Unity 2017.1.0f3. I imported a project from an older version of Unity it worked perfectly and allowed me to build for Android. I logged in to the Asset Store through the tab in ...
6
votes
1answer
576 views

Instantiating prefabs by dragging in scene not working

So I have this problem where I try to instantiate prefabs as in this video for example. I can take instantiate one prefab to the scene, but if I try to instantiate a second one to the scene (whether ...
0
votes
0answers
29 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
20 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 ...
-2
votes
2answers
31 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
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 ...
0
votes
2answers
71 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
61 views

Get the tile in unity tile map

I am trying to get the sprite of a tile in unity from where a raycast hits. Right now it only works in some cases, and always in positive x. This is my current code. ...
2
votes
1answer
48 views

Limit rotation angle

I am currently trying to rotate the weapons of a spaceship towards the mouse position, but in order to avoid the collision of projectiles with the ship I want to limit the angle the weapon can turn. ...
3
votes
1answer
54 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 ...
0
votes
2answers
53 views
3
votes
1answer
74 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 ...
0
votes
1answer
345 views

Lat, Lon and elevation Conversation into unity coordinates

I have came across a very vague project problem and its feasibility report or communication procedures I have to define. And here is the current scenario: I have two applications One is built on ...
1
vote
1answer
26 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
27 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 ...
1
vote
1answer
66 views

Textures in build duplicated, despite they're packed into atlases

I have a simple SpriteAtlas: "UIAtlas" which is located in the Resources folder. It points to a folder "UIAtlas" which contains ...
2
votes
1answer
110 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.
20
votes
1answer
1k views

Why do I seem to lose control of my computer when full screen Unity game loses focus?

When I press Ctrl+Alt+Esc or Ctrl+Shift+Esc the game loses focus, but then the whole PC is unusable and I need to restart the PC to regain control How do I prevent the computer from locking up (let ...
1
vote
0answers
22 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
1answer
39 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 ...
0
votes
1answer
24 views

Unity AR Ground Plane Detector

I need to check a "ground plane" to put objects over it without a marker, using Unity. Right now I'm using Vuforia, but the Ground Plane on Vuforia only works on some devices, I tested on mine and my ...
0
votes
2answers
240 views

SerializedProperty to UnityEvent in a Custom Editor

I am making a Custom Editor for a type that includes a UnityEvent property. I'm currently facing an issue in converting a SerializedProperty to get that UnityEvent. Here is how I declare the event ...
3
votes
1answer
50 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
4answers
2k views

How do I add a Rigid body and a box collider component to a Texture2D?

I am making a snake game. I'm basing it on a basic tutorial game, which does no collision detection, wall checking or different levels. All snake head, piece, food, even the background is made of <...
3
votes
1answer
47 views

How do I get an object to rotate in world space via RigidBody.AddTorque?

I'm getting really discouraged because I can't seem to figure how how to rotate my object via Rigidbody.AddTorque like it is on a figurative global turn table rather than a local turn table. Another ...
0
votes
1answer
27 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
1answer
55 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
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 ...
-1
votes
1answer
46 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: ...
4
votes
4answers
3k views

Unity: Assigning a key to perform an action in the inspector

I am trying to write a simple piece of code in JavaScript where a button toggles the activation of a shield, by dragging a prefab with ...
0
votes
0answers
15 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
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 ...
2
votes
1answer
31 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
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 ...
0
votes
1answer
727 views

Trying to load .json questions and answers into a multiple-choice quiz game in Unity

I am developing a Unity game which includes a multiple-choice quiz. I've placed what I believe is a properly-formatted .json file (the quiz question, four answer choices, the correct answer, and an ...
0
votes
1answer
656 views

Loading a list of items from JSON, all entries are null

(I posted a very similar question here recently and the response I received was helpful. But I have been advised to start a new question, and here it is.) I am developing a Unity game which includes ...
1
vote
1answer
46 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): <...
9
votes
1answer
888 views

How can I fix zig-zagging UV mapping artifacts on a generated mesh that tapers?

I am creating a procedural mesh based on a curve and the size of the mesh gets smaller throughout the curve as you see below. And the problem is UV gets zig-zagged as the size changes (it works ...
1
vote
1answer
68 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/...
4
votes
1answer
96 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
1answer
86 views

Adding text to gameobject

I'm trying to create a falling word game like z-type (code here). I have created 3 game objects and I want the words to be added as text to these game objects something like a health bar is added to ...
0
votes
3answers
1k views

How to import camera from Blender into Unity3D

I have a few cameras in Blender to export to Unity3D. They're exported as empty GameObjects, and that's what is expected. The idea is to have the main camera be a ...
1
vote
1answer
57 views

How to Steer a Moving Object Away From Another Object(s)

I'm working with C# in Unity, and I'm making a top-down space shooter game in which there are many different AI-controlled ships flying around. The problem is that these ships often fly on top of one ...
0
votes
1answer
27 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 ...