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

Unable to capture transparent background with post processing on while taking a screenshoot in Unity URP

I am trying to capture a screenshot of a sprite with transparent background and it works while post processing is of, but when I turn post processing on background is no longer transparent. I am not ...
1
vote
1answer
28 views

Unity Input: Thumbstick works in editor, not in WebGL

I've built a game in Unity 2017.1.1f1 for the web. I have inputs to allow user to play with either the keyboard or a gamepad (in my case, a Gamecube USB). So far as I can tell, all controls work fine ...
2
votes
0answers
39 views

Collapse a 3D model to 2d with Shader?

I'm trying to recreate an effect of 3D sprites similar to Ocotpath Traveler (2d sprite similar to billboards/imposters in 3D space, showing 8 sides of the character based on where they're facing), ...
0
votes
0answers
15 views

Unity - jagged shadows when export as apk?

Alright, I found this question with the same problem but it's out of date Jagged shadows with default settings My problem is a discrepancy between shadow quality settings in editor vs apk built to ...
0
votes
1answer
31 views

If I create a prefab out of an object on scene will my game take more memory in Unity?

If I create a prefab out of an object on scene will my game take more memory in Unity? I have 30 enemies on my scene. I created a prefab for every one of them. I am going to use each of the created ...
0
votes
0answers
22 views

Platforms are gradually being spawned further and further away in the Z-axis in a 2D Endless runner game, until they spawn behind the camera

I am creating a 2D endless runner game, where new platforms get spawned when the player reaches a certain distance to the last platform spawned. The issue that I found was that after the player ...
2
votes
0answers
18 views

How can you play MPEG-2 Transport Stream (.ts) video files in a WebGL Unity build?

I'm trying to play an HLS live-stream within my Unity app. I could write a script for fetching the short .ts video segments and enqueuing them, but I don't know how ...
-2
votes
1answer
29 views

I need a game over (UI image) to appear after timer reaches 0

So here is my timer script that works fine. I need it to activate the game over (UI image) when the timer reaches 0. I tried attaching a game over script to the UI image (GOS script)..... no luck <...
0
votes
1answer
13 views

how do i destroy a DontDestroyOnLoad Gameobject

I have a DontDestroyOnLoad Gameobject and i just can't destroy it I have tried a lot of things. ...
10
votes
2answers
2k views

What is the Library folder and why is it needed?

What and why does the Library folder in Unity projects do and why all recommend adding it to .gitignore when working with VCS (version control system)? Only it can be somehow simpler, and not like in ...
1
vote
0answers
14 views

Unity Input System: How to handle input from specific device types when the binding abstraction fails?

Is there a way for Input System code to determine what kind of device generated an Input Action's current event, so that it can be filtered based on device type? The example I have is an Orbit Camera ...
2
votes
1answer
35 views

How to manage a lot of items on conveyors

I am making some sort of factory game (topdown 2D) where I will have machines outputting items on conveyors. I was wondering what was the best approach to manage the items on the conveyors. There are ...
0
votes
2answers
75 views

Why can't the player walk properly on the moving platform?

I'm making a platformer with Unity. In one of the scenes, I have a moving platform that moves back and forth. The problem is that the player can't walk (or sometimes jump) properly on the platform and ...
0
votes
0answers
13 views

Can't get player to walk to object using NavMeshAgent

How can I get my player to walk to an object using NavMeshAgent? I've tried multiple tutorials and tried things I've come across online, but none of them has solved ...
0
votes
1answer
26 views

How could I intercept a save scene action being run in Unity?

How could I intercept a save scene action being run in Unity? There is some code I would like to run in editor whenever a scene is saved. Is it possible for me to detect somehow when a scene is saved?
0
votes
0answers
17 views

How could I recreate a destoryed object in Unity?

How could I recreate a destoryed object in Unity? I want to implement a system which would respawn my enemies after I kill them. I have different kinds of enemies with different kinds of ...
1
vote
0answers
32 views

What is the new Input System equivalent of Input.GetAxis(“Mouse X”)?

At first, it seems that Mouse.current.delta.x.ReadValue() would be the most equivalent, but they give different outputs. The purpose is porting old Input code to ...
0
votes
0answers
49 views

How to decay sine or cosine wave so it takes one additional period to reach equilibrium

In many shmups, when enemies arrive, they accelerate onto screen, decelerate, and overshoot their static arrival position slightly, before backing up slowly to the position. This can be seen in many ...
1
vote
1answer
17 views

How to change multiple materials attached to one GameObject

I am working on a script that changes the material of a selected object when hovered over. The object(s) in question have multiple materials attached. The problem is that only the first material is ...
0
votes
0answers
60 views

The variable hasn't been assigned(but it has)

I'm trying to make Pause Menu. When I press "P" to pause/resume game it works. But When try to resume game via button it gives this error. ...
3
votes
0answers
16 views

Show meshes in orthographic views in Unity editor

A long time ago I used to map using GtkRadiant and then UDK. Both of these editors had both 2D and 3D viewports at the same time, so you could do your floor plans in 2D and easily do alignment and ...
0
votes
0answers
5 views

Solving the problem of thick colliders at intersections?

While I somehow solved my collider issue in about 99% cases, there are cases where the solution simply doesn't work. This is an intersection and the logic of thick colliders simply don't work here: ...
-1
votes
1answer
40 views

Several questions about Unity license and revenue from games

So, what I know is if I'm using Unity Personal Edition and start earning more than $100,000 I need to upgrade to Plus or Pro, but I have some questions: If revenue from the game reached more than $...
2
votes
0answers
39 views

How can we use an iPhone camera as a webcam on Windows?

I am developing a game on Windows and I want to use my iPhone 11p as a webcam (for video streaming). I saw some tutorial videos on YouTube, yet they only work for development on iOS platform in Unity. ...
1
vote
1answer
34 views

How do I create a perfectly set up FBX file by script?

I have a huge FBX file which contains make animations. I want to split these into different takes by using a C# script file. It worked, but it happened often that I messed up the FBX file because my ...
2
votes
1answer
47 views

2D vs 3D mobile power consumption in Unity [closed]

For an optimised and playable game written for mobile with Unity, how much of a difference is there in power consumption between 2D and 3D? Assuming: Unity game engine The game requires constant ...
2
votes
1answer
36 views

Unity intersection of mesh renderers on Android

I’m currently developing a game with Unity and ran into a problem while building for Android. The player and obstacles are mesh renderers (for example cubes & boxes). On iOS and the Unity editor, ...
0
votes
2answers
69 views

Unity WaitForSeconds without generating garbage

In Unity you can use: IEnumerator WaiterRoutine() { yield return new WaitForSeconds(<seconds as float>); } To wait a number of seconds. ...
2
votes
1answer
45 views

How big can/should wall colliders be?

Following my previous question, I now have my wall collider building tool and built many of them: Bird-view, about 17 walls selected, on the right, one is selected: Here, wall and barriers form a ...
0
votes
0answers
61 views

Using Particle.position to place particles - positions incorrect?

I have a particle system based on this answer to another question about manually placing particles (no movement). However, it's very costly to run Emit() after ...
0
votes
1answer
10 views

Overriding template variables for Gradle generation

I'm using Unity 2020 to build for Android. Unity provides a mainTemplate.gradle file, looks a bit like this. As per Unity docs, there are certain template variables ...
1
vote
1answer
30 views

Box selection with Physics2D.BoxCastAll is mirrored when selecting in the bottom half of the screen

Using Physics2D.BoxCastAll based on rectangle is working fine when drawing is started on the top part of the screen, but when drawing is started on the bottom you can see this strange mirroring effect....
1
vote
1answer
43 views

Difference between ComputeBuffer and GraphicsBuffer in Unity?

At first I thought that ComputeBuffer's could only be used in compute shaders and that GraphicsBuffer's could only be used in ...
2
votes
0answers
80 views

Model missed by both EventSystem.current.RaycastAll and IPointerClickHandler when scaling time

Update 3: I've found a workaround, but why the problem only manifests when scaling time still mystifies me. Bounty still up for grabs if someone can work out why. Original post: I have a situation ...
1
vote
0answers
40 views

With Unity, why this character with a rigid body and child element colliders doesn't collide with the floor and go through it?

I got an issue with my character going through the ground and actually going through all other elements with a collider. I'm going to try and show as much as I can of the current state of things. My ...
1
vote
1answer
35 views

Instantiated entities don't collide with each other

I've started to learn DOTS some day ago, and decided to create a simple project. When I added some simple physics to the game I faced the problem. I added one object on the scene and another ...
0
votes
0answers
16 views

How can I reset the cloth to its original (start) position?

I got a cube that is a cloth and it doesn't have any forces applied to it. It has a ball inside and I can move the ball inside to collide with the cube cloth and make a nice animation. Sometimes, if I ...
0
votes
0answers
13 views

Changing sprite renderer material in gameplay

I'm having an issue on some android devices with one of my games functions. Its a puzzle game and i assign different materials on the generated images pieces which causes the game to freeze on some ...
0
votes
0answers
33 views

Box collider not colliding with Character controller

I have a player with a CharacterController attached. The player can move around. There are obstacles which the player can collide with. These obstacles have a ...
3
votes
1answer
40 views

How do I remove the shinyness from the terrain when using an orthographic camera?

I am having an issue with terrain having a sheen around edges when I set the game camera to orthographic. Changing it to perspective, the shinyness goes away: I have tested with textures from the ...
1
vote
1answer
18 views

Dynamic bridge via joints

When a new object is added to the bridge, the bridge shakes violently, and when objects are added even faster, it breaks. I've tried changing mass and changing time step, but that doesn't solve the ...
2
votes
0answers
27 views

How do I iterate through keyframes in an animation clip?

I have an animation clip that animates a complex model. I would like to ask if it is possible to iterate through all bones and their key frames like that: (pseudo code) ...
0
votes
0answers
16 views

How do I translate anim values to script?

I need to copy the values of an anim file to a new animation clip. However, I don't understand how these values could be translated to / by script. I see several key frames, but not all key frames ...
5
votes
1answer
72 views

How to make different Rule Tiles interact with each other?

I am using Unity's RuleTiles to automatically change sprites of adjacent similar blocks. For example, when a Dirt tile notices there are two ...
1
vote
1answer
19 views

How do I split an anim into separate takes?

I can split the animations of an FBX file into individual takes by script. However, I have not found a way to do that with .anim files. Is it not possible to split .anim files into individual takes? ...
1
vote
1answer
19 views

I need help converting Unity .shader to Shader Graph: Bumpy Glass

I've been tasked with converting an older Unity shader which does Bumpy Glass with some alpha modification, to URP. I'm assuming that means using Shader Graph. I'm a bit new to shaders in general, but ...
0
votes
0answers
12 views

How do i Change a GameObject from another script to the GameObject the current script is on [duplicate]

im trying to set the game object in script1 to be the game object script2 is on ...
0
votes
1answer
22 views

How to make a GameObject occasionally change direction in Unity?

I'm trying to create a periodic timer in Unity, so that I can create a GameObject that randomly moves around. Unfortunately, with my current code, the GameObject goes in a constant direction and doesn'...
1
vote
1answer
40 views

How can I improve the performance of my game that plays a video?

I have a level where I have embedded 5 short videos and the levels lags a little compared to the other levels, so it seems that adding videos in a Unity made game is expensive on its performance and ...
-1
votes
0answers
24 views

Are finger tracking gloves compatible with Unity collision physics?

I'd like to do live hand/finger mocap with tracking gloves (maybe Rokoko or Xsens or Perception Neuron?). It is crucial however that the live mocap allows for working collisions in Unity. For instance,...