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

Generating code on file changes in Unity Editor

I'm trying to generate code on changes using file watchers: ...
0
votes
0answers
10 views

Texture appears black when EditorUtility.CompressTexture()

I'm working on an textureAtlas builder, the atlas itself is a scriptable object which holds settings and reference to source meshes and materials. I have the actual atlasTexture as a subAsset of the ...
0
votes
0answers
8 views

Unity hands not showing and shaders are tinged pink when deploying to Android and running on quest

So when I run in editor ( 2021.1.16) everything works and looks good however when I deploy to my headset as an APK my Hands are not shown and everything has a strange pink tinge to it. Its not the ...
-1
votes
1answer
15 views

Error CS0234 and CS0236 in Unity

I'm trying to make a simple button perform an action when pressed. Initially I was using vscode, but as I couldn't solve the problem, I switched to visual studio 2017. For some reason the error ...
0
votes
0answers
21 views

How to check if object is inside another

Im creating a city building game, and i need to check if the building is 100% inside the grid, which is currently a 3d cube (using only the X and Z coordinates of the building) i thought to take the ...
0
votes
0answers
11 views

Ensuring world curving shader is not affected by object scale

I've made a shader shown below which essentially acts as a "world bend / curve" shader by "bending" objects depending on their position from camera. It's a subgraph that outputs ...
0
votes
0answers
13 views

How to generate a randomly-positioned leaf quads with a geometry shader?

Does anyone have any idea how to implement a shader that manages to make this effect in Unity? I found a post that explains, but I'm still learning shaders so I didn't really understood how to go ...
0
votes
0answers
9 views

How to teleport a kinematic Rigidbody2D with the interpolation settings on?

I would like to start by quoting some parts of the documentation. The first thing that catches my eye is the difference in the description of the MovePosition ...
0
votes
1answer
19 views

how to add overall collider to a bunch of circles or boxes?

I have 3 circles (2D) they all have circleCollider2D. what I want is to make a collider that make border around them. I can't express which type of collider I need, so I put example image below. Red ...
0
votes
0answers
10 views

Confused on OpenglES uniform buffer alignment

I am now doing some customization to Unity Engine. I am trying to optimize the rendering process. I observed that each time Unity build a batch, it will create a new uniform buffer to pack bulit-in ...
1
vote
1answer
41 views

How to make my Unity project deterministic for replays?

I am working on an arcade-style 2D shmup and recently started implementing a replay system that allows players to view their runs of the game. I use the technique of recording input each ...
0
votes
0answers
8 views

Unity addressables errors with Android split binary

We're using Unity 2020.3.18f1 and Addressables 1.19.4 (we've also tried 1.18.15) Google requires us to split the game up before uploading it to the google play store. We built the game into an .apk ...
0
votes
0answers
17 views

How to get a reference of a script from prefab child?

The Scene Fader prefab is dragged to the OnGameLoading script : The scene fader prefab structure is with two children and the script I need to get a reference to is on the second child : And the ...
-1
votes
1answer
31 views

How can I detect when the mouse cursor is over a button?

Not clicked event but over the button event ? I want that when the mouse cursor is on the button call a function. When I click on the button it's calling the function playing a sound. I tried to add ...
2
votes
1answer
48 views

How to draw a box in Unity Runtime?

I'm currently working on an AR application that is able to measure volume. The functionality is required to draw a box is in the gif attached to this. I have tried to generate instantiating 3 points ...
0
votes
0answers
16 views

Google's Play Asset Delivery Build aab File in Unity too large

I want to upload an aab file from my unity project to my play console account, but unfortunately, my file was rejected because it's size is larger than the 150MB threshold limit for aab on google play ...
0
votes
0answers
11 views

Automatically create capsule colliders from bones?

I have tried to automatically generate capsule colliders from bones by temporarily creating a mesh collider and using raycast to find the distance to it from the bone, but when I create the capsule ...
0
votes
1answer
15 views

Unity world curve shader graph, how to start curving from a specific distance?

I've made simple world curving shader following some online tutorials and cleaning few things up. It's doing its job, however I have small issue where it curves objects that are very close to a camera....
0
votes
0answers
10 views

Unity 2d - Enemy continuous curved movement

I'm trying to implement random enemy movement in a top down shooter game. Currently the enemy moves in a straight line from his current position to a randomly generated target position. Is there any ...
0
votes
0answers
15 views

Making texture atlas in Unity

For optimization purposes and reducing batches count, I am trying to combine my floor tiles textures into different atlases. Sharing the same material with an atlas can decrease draw calls and hence ...
0
votes
0answers
15 views

unity - playing animation in heavy load and in parallel

I'm basically having a large amount of code for UI, and it seems to be making my animation freezeup for a bit. I can't write paste the whole code here, but, here's an explanation of what's going on: <...
0
votes
0answers
33 views

How to make a player go through a wall and then can't go back

I want my player to go through a wall or a GameObject, but when it goes through it, the player falls back down due to its Rigidbody. I want the player to not be able to go back through the GameObject ...
1
vote
0answers
18 views

How to check if Texture 2D was provided in shader graph?

I have following section in my shader graph, that I want to simplify. At the moment I have to set manual boolean Use Normal Map in order to decide if I want to use a Normal Map texture or default ...
-1
votes
1answer
34 views

How to calculate speed of a moving object in unity

Currently I am trying to calculate the speed of an object here is the below code snippet: ...
0
votes
0answers
41 views

How can I organize in Unity's hierarchy GameObjects that are spawned in a nested structure?

I'm wondering how I can organize instantiated GameObjects that are spawned in sort of a nested structure. I'm spawning these GameObjects via Containers, a set of ...
0
votes
0answers
10 views

How to find the center of mass from CapsuleCast in unity

Is there an easy way to find the center of mass from a CapsuleCast, or should I find the geometric center of it?
0
votes
1answer
37 views

How to make Ai use ouMouseDown() and onMouseUp() function in unity?

I want to make an ai for my game. Currently my game controller uses onmousedown and onmouseup functions and some other factors? My game is for two players on same screen but you don't always have ...
0
votes
1answer
56 views

What is an alternative solution to the problem of polygon collider2D not following character (animation)movement?

A 2D game and a bird's eye view of the character. This character, who has a knife in his hand, swings the knife by waving his arm, just at this time, I look at "polygon collider2d" from the ...
0
votes
0answers
30 views

Unity Library size getting bigger and bigger

Why is unity library folder size getting bigger and bigger. Once i delete all the folder then its double the size according to my asset size. Now i made several build and my size almost reaching to ...
1
vote
1answer
53 views
+50

Player rotation recalculation causes jittering on edges

When my player walks around a circular planet everything works well, but when my planet is a shape like a cube or a dodecahedron, even with smoothed edges, my character jitters if I walk slowly on the ...
0
votes
1answer
43 views

VS code sometimes doesn't recognize Unity APIs

Unity debugger plugin and C# plugin are installed but Visual Studio Code does not recognize Unity APIs. Intelisense does not work. How can I fix?
0
votes
1answer
46 views
1
vote
0answers
36 views

How to move game pieces in checkers?

I have been creating a 3D Checkers board game via Unity. So far, I have managed to create the board game, with its game pieces well positioned into their designated rows and tiles upon starting to ...
0
votes
0answers
16 views

Photon+Playfab Authentication: Photon Application Not Found

I've been trying to make this PlayFab+Photon Authentication script for my multiplayer game from this Photon quickstart guide but I got this error I have been trying to resolve: 🗨 PlayFab ...
0
votes
1answer
20 views

Prevent Player from Moving During Jump

I am new to Unity, and am trying to make a simple 2D platformer from this video, and I am trying to modify it to prevent the player from being able to switch directions during a jump. Right now, you ...
0
votes
0answers
12 views

PropertyDrawer dependent on other property in monobehaviour

I would like to extend the unity editor for a scriptable object I am setting up. I have a list of named maps defined on the SO, and afterwards I want to set up in another list some features that ...
0
votes
1answer
40 views

Why the transform is not looking at the target?

The goal is to make smooth rotating look at. The parent object is my character have a Rigidbody. The script is attached to the character parent. I make a reference to the character child name head. I ...
0
votes
1answer
64 views

Combining two objects to give you one more elaborate one

I'm looking for some help to someone throw me a light on this problem I'm having. We're making a clothing game where you got to grab a "cloth" and a "string" and bringing them to ...
1
vote
1answer
28 views

Can I cache and edit Unity RaycastCommands?

I'm simulating a LiDAR and am working to optimize the code. In following along with the RaycastCommand documentation, I have the core functionality working and I'm trying to optimize it. I see where ...
0
votes
0answers
32 views

How to create random interpolated polygon shapes based Mesh in Unity?

I want to generate random Polygon (or maybe I am not using correct term) shapes as Mesh generated randomly and dynamically from script in runtime as shown in the picture attached. I want to use as ...
-2
votes
1answer
27 views

unity c# issue unable to get perfect position of a enemy in unity c# script using transform.position

when I command or set an enemy to go left and then at reaching a particular state or position i say my enemy to go right but it is not going right and not reaching to perfect position here is the code ...
0
votes
1answer
33 views

Unity - Make child not scale on X

I have a character that can move left and right. Whenever it changes direction the character's localscale x is multiplied by -1. The code looks like this: ...
0
votes
1answer
32 views

Control a specific material property in a mesh renderer?

I want to animate a mesh which has 4 materials, all of them are using the same shader. now, I want to animate the "emission" property of material[0] and material[2], but not material[1] and ...
0
votes
0answers
30 views

Why is mouse sensitivity so high in WebGL build?

I made an FPS game in unity3d and exported it to WebGL. When I tested that, however, the mouse sensitivity was quite a bit higher than in the Unity application itself. I used the standard assets ...
0
votes
1answer
42 views

Should building interiors be in separate scenes in Unity?

I have an overworld with multiple buildings in it. Each building has a separate interior model with ~500 triangles. I was wondering if it would be better for performance to store the interiors in the ...
0
votes
0answers
16 views

Can you instantiate a bunch of objects really fast in VrChat?

I want to know if you can instantiate objects as fast as an avatar can run. I want to create a path of objects based on a path that a player has drawn that an avatar can run on. To do that, I want it ...
0
votes
0answers
37 views

camera snapping weirdly when aligning to view

The apply word above comes from 'blender 3D'. Basically, once you rotate an object , it's x, y, z value changes. What apply does is keep the transformation, but, change the x, y, z value back to 0. Is ...
0
votes
0answers
26 views

Unity3D Scene maximum recommended Size/Vertex count

I am about to start making a low-poly open world RPG. That said what would be too big for a single scene, as in maximum recommended amount of GameObjects/Colliders? Sorry for the stupid question but ...
0
votes
0answers
28 views

How to view logs of a Unity PC build in realtime?

For Android builds, I can use Android Studio, mLogcat or many other tools to check device logs in realtime. For iOS builds, I can use the code console to checks the logs in realtime. Is there any way ...

1
2 3 4 5
290