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.
13,621
questions
0
votes
0answers
11 views
How to increase drag sensitivity while dragging distance is less than a certain value
I built a inventory hotbar wheel for mobile controls. The wheel can be accessed if I put my finger on a specific "hitbox" on the right side of the screen and drag left. The result looks like ...
0
votes
0answers
22 views
Index out of the bond of the array for values higher than 9, why?
I'm a bit confused here. When the const int chunkNum is highter than 9, it give me the error and instead of getting 10 x 10 chunks, i get 10x 9 chunks, but for a ...
0
votes
0answers
23 views
TMPro Double Outline
Hi, This is what I am trying to achieve: TextMeshPro with double outline.
So far I have tried these combinations:
TextMeshPro + Outline[int the mid] + Underlay [external]. It is close, but not the ...
0
votes
1answer
50 views
0
votes
1answer
28 views
Player angle following camera
I'm creating a third-person game. I want the player-model to follow the rotation of the camera. I do that with this :
...
1
vote
1answer
47 views
How can I obtain the file size of a Unity build at runtime?
I'm wondering if it is possible to obtain the filesize of a game's build at runtime.
Searching this topic only yields results for reducing the build size, which is not at all what I'm looking for.
0
votes
0answers
12 views
Unity project not communicating with my iPhone 11?
Connecting to my iPhone 11 with a cool FaceTracking project called FaceCapOSCReceiverExample https://github.com/hizzlehoff/FaceCapOSCReceiverExample works excellent on my laptop, but not on my PC (...
0
votes
1answer
64 views
How to Make Organic Fade to Black in Unity [closed]
I'm working a retro/old-style video game, and I was wondering whether or not there is a way to create an organic fade-to-black, similar to what is found in the original NES console. I am aware of how ...
0
votes
0answers
43 views
How to calculate High Score in game when there are two units in the game?
In my game I am solving a problem, and I am getting certain points for each problem.
Just like collecting numbers falling from the top.
Now I want to calculate a high score on the basis of two items i....
0
votes
0answers
50 views
Checkerboard like rendering does not save performance
I have a simple scene in Unity with a camera and a quad facing the camera filling the whole viewrect.
The quad has a material with the following shader:
...
0
votes
0answers
40 views
How to proper manage a world composed by multiple scenes?
I have a UI-only scene for my game that have only Unity UI elements (those that need a Canvas), separate from the world scene.
In the UI scene I have a MonoBehaviour that manage all the effective ...
0
votes
1answer
35 views
pick up material from another object
is it possible to obtain a material from another object?
I'm trying everything and nothing, the only thing I could get was just the color of another object
...
0
votes
0answers
9 views
Working with websockets in Unity: Cannot convert lambda expression to type 'IObserver<ReconnectionInfo>' because it is not a delegate type
I'm a bit stuck on a delegate error in Unity. The code works fine if I'm in a c# console app however Unity is giving me the error:
Cannot convert lambda expression to type 'IObserver' because it is ...
0
votes
1answer
34 views
Why isn't my tilemap collider appearing?
I am trying to make a 2d game but my player falls through the tilemap every time.
My tilemap collider doesn't seem to show up.
What is going on and how do I fix this?
The first image is rigidbody ...
0
votes
1answer
52 views
Unexpected result when generating world with 2 perlin noises
I try to generate a world with a temperature and an humidity noise to generate biome based on the y values of the two. I take the y values and round them on a 33 base for the humidity and 25 for the ...
0
votes
0answers
20 views
Skybox from file at runtime in Unity: Error assigning 2D texture to CUBE texture property '_Tex': Dimensions must match
I'm downloading skyboxes at runtime, and then I'd like to set them as the current scene's Skybox.
After I successfully downloaded the desired cubemap into the ApplicationData folder, I'm trying to set ...
0
votes
0answers
14 views
Cinemachine third person camera movement causes misalignment
I'm working on third person movement using CinemachineFreeLook as the player camera. At first I thought it was working fine but I've noticed that moving left/right actually moves the character with a ...
0
votes
0answers
22 views
How are writing shaders different in Unity's scriptable render pipeline vs the standard pipeline?
So I want to start learning how to write shaders because the shadergraph seems very limited at the moment. I've done some research and it seems that I should learn the HLSL language which is used by ...
0
votes
0answers
45 views
I can't figure out why the bool flags are not working in the right order?
This script is attached to a wall :
...
0
votes
1answer
101 views
Moving non-local player from local player with Mirror Networking
i am using mirror networking which is based on UNet. I can move non local objects easly by assigning their authority to the local player and move them, but i can't assign/remove authority for other ...
0
votes
0answers
59 views
How to improve performance with a lot of bullets and Mirror networking
The game
I have 300 enemies with rigidbodies. I also have 1 to 4 players with rigidbodies.
And they shot a lot of bullets. I have 1000 bullets with circle coliders only (no rigidbodies for bullets)
I'...
1
vote
2answers
46 views
Unity raycasting not always detecting component
I am trying to determine what object I am clicking with the help of a raycast, however it doesn't always work
In update I call:
...
0
votes
1answer
141 views
Can I legally modify the Unity splash to fit the game's theme?
I've been working on a retro game, and I was wondering whether I could change the Unity logo to make it fit the game's style (eg. pixelating the logo).
I know how to do this, but my question is ...
0
votes
1answer
53 views
How can I programmatically add a Controller to an Animator during runtime?
I am trying to set the Controller of an Animator during runtime using a script.
When I click on the dot in the inspector manually, I can choose one called "Standard Walk", but have not found ...
0
votes
1answer
35 views
How to align prefab to a accurate position with the best practice?
I'm making a plumber game, I have a pump prefab, and pipe section prefab, which allows the user to connect the pipe during game, the pipe needs to be connected seamlessly during game, which means pipe ...
0
votes
1answer
22 views
Humanoid Rig Animations Not Playing Properly
Although I have seen a few questions that are similar to my own, none had specific or clear answers that actually solved the problem, so here I am.
Just recently, I have imported a rig from Blender ...
1
vote
1answer
24 views
How can I call Schedule() on interface that inherits from IJob
So I have a voxel terrain engine, and I have an interface that all meshing jobs should inherit from. That looks like this (simplified from the actual):
...
0
votes
0answers
16 views
how to make my camera follow script work for Photon Pun2
I´m currently working on the Multiplayer part for a 2D top-down game. I´m using Photon Pun2, to do this. My problem is, that always just the last player, who joined the game get´s my camera follow ...
0
votes
1answer
36 views
For dynamically batched objects the `unity_ObjectToWorld` shader variable is always set to default?
I'm using the standard render pipeline and the unity_ObjectToWorld variable for some calculations in my shader. After I enabled dynamic batching these calculations ...
0
votes
0answers
17 views
Terrain shadows not rendered to additional camera with Unity3D URP
I'm running into problems with a project using several cameras rendering to different monitors.
The first Camera (a VR camera) renders the foliage and the terrain correctly.
However, in the second ...
0
votes
1answer
50 views
Unity error: type “x” exist in both 'A' and 'B'
I just opened a project made in unity version 2018.1.1f into Unity version 2020.1.1f
I know opening the older projects is not supported by Unity but it opened fine.
The only problem is that it is ...
0
votes
1answer
72 views
How to correctly instantiate prefab in Unity
I made a prefab and drag drop it to the Tile Prefab slot as shown in the picture
In my code
...
0
votes
0answers
22 views
How can I generate a wall/s?
I want to create for example 4 cubes and then to connect them all making a square but making them scaling to one direction and not two directions as by default.
The prefab variable is a Cube.
I have ...
0
votes
1answer
28 views
Buttons only trigger right/left movement once, not continually
I have a Unity mobile project where I am trying to use right/left movement using two UI buttons situated accordingly. The issue is that it only moves the player to the right/to the left one time, not ...
0
votes
0answers
29 views
MissingReferenceException being thrown in async method
I'm trying to create a UI pop up box to show messages. It is a simple component: it's only a background image, a text and a script to manage it.
The script is very simple and just have a ...
0
votes
1answer
30 views
Building meshes conforming to terrain deformation
I have an uneven terrain on which the player is supposed to build buildings. For most structures I can just fudge the foundations, have them extend through the terrain.
For roads, pipes, tracks and ...
0
votes
0answers
11 views
Using Mobile Accelerometer to trigger an action in my game unity
Hi I have this project I'm working on which is a bowling game controlled by mobile acceleration. I want the following:
when the player holds the phone up facing him for 2 seconds to enter strike state....
1
vote
1answer
58 views
How to use only mouse to move player? [closed]
I'm developing a web-app with Unity.
Instead using 'classic' keyboard WASD + Mouse , i would like to use only mouse to move my player, using left-click and move "toward" mouse cursor ...
0
votes
0answers
34 views
How can I add a collider/s to a line renderer circle?
With this code I can create a circle using LineRenderer and control in both editor mode and run time mode on the drawn circle properties like radius and width and height.
Now I want to add to this ...
0
votes
0answers
21 views
Not able to assign any scripts to my game object [duplicate]
I am not able to assign a particular C# script to a game object. When I try to do so, I get this error as shown below Only the script I have is different.
In brief, just like the error above I am ...
0
votes
1answer
25 views
How can I build a virtual barrier to block and prevent from the player to keep moving forward?
This is my logic :
When the player is moving I'm getting the distance from another object.
When the player is at distance for example 61 slow down the player moving "Forward" until the ...
2
votes
1answer
26 views
Why Unity Corrupts textures when used on a Sample Texture node shader
I am trying create a glow effect on a background, to do this I am using shaders, when I use the main texture everything is okay, but when I put the emission map the texture corrupts
Here's the ...
0
votes
1answer
29 views
Why are setcolor and color not reset
When I do a color exchange directly on the material in playmode, but then I go back to editmode, why do the settings still remain?
For example:
...
0
votes
1answer
45 views
A terrain with underground tunnels
The Terrain tool in Unity is great for constructing 3-D landscapes that are open from above. I am working on a game that happens entirely inside tunnels (specifically, blood vessels in a human body. ...
1
vote
0answers
23 views
How to add a falloff (transparency) to projector shader in Unity?
I am new to Unity shaders and I was wondering if it was possible to add a falloff variable to control the transparency of the projected color. Here is the shader code :
...
1
vote
0answers
45 views
Multiplayer server with firebase and unity for an indie game? [closed]
I am developing my first indie mobile game using Unity3d, I have integrated google firebase (firestore) to store game & user profile data, also I am using firebase user login service, currently I ...
1
vote
1answer
69 views
Creating a simple countdown timer in unity
Hello's I was looking for a way to do a countdown timer in unity and stumbled across this solution :
...
1
vote
0answers
29 views
Unity - On Custom Editor Update Event
The following code is a snippet of how I'm auto-updating an object whenever a setting changes in the inspector window (for a scriptable object). It's currently not working, but It will work if I put ...
2
votes
1answer
118 views
How to Detect a Right Mouse Click on a UI Button in Unity
I've been recently working on a videogame, and I'm trying to make a script that will destroy the game object it is applied to whenever the right mouse button is clicked on it. It doesn't function at ...
3
votes
1answer
46 views
Unity: How can I find the center position of a particular triangle?
I need to face an object from a central point directly through any one of many triangles which are faces on an icosphere whose position is centered on that point. Is there a way to get the center ...