We’re rewarding the question askers & reputations are being recalculated! Read more.

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
3
votes
2answers
131 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
42 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 ...
3
votes
1answer
55 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
2answers
197 views

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
28 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
14 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
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
61 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: ...
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
0answers
6 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
11 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 ...
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 ...
-1
votes
1answer
49 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
46 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
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): <...
0
votes
1answer
28 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
110 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
32 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
32 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
20 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
23 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
70 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
48 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
12 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
41 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
15 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
20 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
30 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
38 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
77 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
40 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
20 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
30 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
13 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
26 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
61 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
274 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: ...
1
vote
0answers
24 views

How do I pause/play animation in Unity without the animation getting cut off

I'm trying to achieve a common game behavior that when you hit an enemy, then whatever the enemy's action (animation) is, when the hit happens, the enemy pauses a bit, then continues with the ...
0
votes
0answers
6 views

To extract Grabpass image as texture2d via script

We applied it to the plane object using Grabpass. I want to import the image shown in plane through script. I want to make the imported image in texture2d format. Is there a way? Below is the relevant ...
0
votes
1answer
28 views

How to raycast from a UI element

How do I raycast from a UI object? I have tried Ray ray; Camera cam; Transform obj; //UI object ray = cam.ViewportPointToRay(obj.position); AND ...
0
votes
1answer
45 views

Avoid spawning Reverese words in word search game

I was trying to modify a project that I found on Github, but the problem of that game is the words of the game is spawning in reversely as the snapshot below. there were two classes that has been ...
0
votes
0answers
21 views

How to make a parallax background for 2D in unity?

I tried to make a parallax background with the following codes: ...
0
votes
0answers
28 views

Convert Rainbow gradient Shader to 3 colors gradient

I am attempting to convert this rainbow shader into just using three colors. I thought I would be able to set the three colors in the shader file, but I can't understand how to link them through the ...
0
votes
1answer
89 views

How to use TensorFlow in Unity

I am trying to implement a deep reinforcement learning IA with TensorFlow for a checker game in Unity. How can I do this? I've searched for it on Google and found a lot of videos and tutorials on how ...
1
vote
1answer
87 views

To split or not to split large 3D objects?

I have a fairly simple question for which I'm seeking guidance: Should large 3D objects be splitted into smaller ones? By wide, I mean an object that would be as wide as a game level is, below is ...
0
votes
1answer
26 views

How to change TPS camera angle in Unity

I'm very new to Unity and this may simply be a failure of google-fu but I hope someone here can help me out. I'm working through a series of tutorials on how to create an RPG in Unity, making small ...
1
vote
1answer
54 views

Using points to unlock next scene in Unity

Below is my code and I'm a beginning game designer trying to make my first game for art school teehee! :) I'm not sure how to unlock the next level with a scene I've already made called ...
-1
votes
1answer
42 views

change color to rgb in c# unity

So I am trying to change my color of my sprite to a rgb color. Now I can just change it to a color like red, black or blue... m_spriteRenderer.color = Color.blue; ...
0
votes
0answers
22 views

Problem with an animation transition

I'm working with a 3D avatar and it's my first time working with animations. I have already done one which goes from the idle animation to another animation. It does the transition when the value of a ...