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

Testing assertions being logged (LogAssert.Expect behaviour) Unity

I am trying to log assertions but cannot figure out what I am doing wrong. ...
-1
votes
0answers
14 views

Rendering between two DrawMeshInstanced() calls in Unity

I am working on a 2D shmup that requires rendering thousands of animated bullets and animated medals on screen at the same time. I use a standard pooling method to activate and deactivate these ...
-1
votes
0answers
6 views

Feet move/shuffle while playing animation

I have a rig from Maya and use animations from Mixamo and some external assets. However no matter what I do the feet shuffle when then animation is playing. There are a few threads on this subject and ...
-1
votes
1answer
14 views

What does the Lock toggle in the Position Constraint Component do?

Even after reading the documentation, I just can't figure out what the parameter does. I experimented in Unity and set different parameters for Position At Rest and Position Offset. I succeeded in ...
2
votes
1answer
25 views

Why is this back-facing texture showing through?

I have a mesh of some walls and a floor that I want to be visible from both sides. I duplicated the faces and flipped their normals in Blender, then exported it as an FBX to import in Unity. I've set ...
-1
votes
1answer
25 views

How can I create a animator parameter in a script, unity?

In unity we can create parameters in the animator tab to help to control changes in animation. I'm able to create this parameters in the unity itself and manipulate them in the C# script, but I want ...
-1
votes
0answers
12 views

Centering Player in Unity Oculus Quest 2 / Hurricane VR

We ran into following problem. When player exits guardian and removes headset [Quest 2] it looses tracking which results in player being moved in relation to scene center by large margin even after ...
1
vote
0answers
38 views

Wait for a function to return value without impacting framerate

I'm looking to do some possibly heavy calculation in my game. An agent in my game needs to evaluate up to 1000 objects while performing heavy calculations to select his next job. I want to either ...
1
vote
1answer
26 views

Animator stuck in previous state and not transitioning, even if transition condition is true

The animator of my character gets stuck from time to time into the first attack animation instead of transitioning to the next one, even if the condition of transitioning is met. This problem gets ...
0
votes
1answer
29 views

Check if a procedurally generated maze built out of cubes is solvable

I have created a procedural level generator in unity. However, occasionally the algorithm creates a level that is impossible to solve. Therefore, I tried to implement a navmesh agent to check if it is ...
2
votes
1answer
32 views

Collision objects aren't preventing falling in Unity

This is a super basic question, but I have absolutelly no clue why there is no collision and the player continues to fall. Im following FreeCodeCamp(minute 37:20). This is what I have: What is ...
-1
votes
0answers
21 views

How to get background effects like that of Duet in Unity?

If you guys are familiar with Duet (Android/iOS) can you give me some idea how to make a dynamic background like that game? What are the elements that are used to make such a thing? I can't find a ...
1
vote
1answer
54 views

How can I create a shader which makes an object transparent in bright light and opaque in low light?

I'm trying to set up a shader that, as the title says, functions similarly to the effect appearing in the "Lights Out" horror short film. Cut down to the very basics, I'm looking for advice ...
-1
votes
0answers
25 views

Help with optimizing 2d WEBGL game for mobile [closed]

I'm working on WEBGL app that needs to be run on mobile. It runs nice on newer budget phone around 60fps but the problem are as expected older phones(around 25 fps on phone from 2017). I know one of ...
-2
votes
0answers
44 views

Unity: board game levels, the Best practice [duplicate]

I'm currently working on a board game and I would like to have several levels (so several different boards). I was wondering what should be the best practice for that. Should I create an Game Object ...
-1
votes
1answer
23 views

Unity - Cant reference UI Image in Script

I'm making an inventory system for my game, part of that is updating the icon when the slot is full. For some reason, I can't reference the image component on the child UI image component. I've tried ...
0
votes
1answer
34 views

Trigonometry to move an arm around axis in 3D space

Hello I have a question about rotating a Rod hinged to a fixed point (so it swings all around), and targets. short form, I would like to know how to find a rotation that would point my rod (while ...
-1
votes
0answers
27 views

How to hollow out an object in runtime

I have created a procedural spaceship generator in unity and am looking for a way to hollow it out to create rooms. (As in create an interior of the spaceship which matches the shape of the outside). ...
1
vote
1answer
19 views

How do I lock the axis in the animation window while dragging?

I want to drag one or more keyframe curve edit points in the horizontal direction only. Here is a rough screenshot of what I'm trying to do. As one can see, I'm having a hard time moving the keyframes ...
0
votes
0answers
18 views

Painting grass and trees on other meshes with Unity terrain

I'm trying to work out a way to add terrain details such as grass and possibly even trees to meshes like rocks and cliffs. I'm just assuming that I might be able to add the meshes to the terrain ...
0
votes
0answers
13 views

Shader from urp shader graph turns gray on webgl1 build

When I build my game while graphics API is set to webgl1 the shader is just a gray texture. It works fine if graphics API is set to webgl2 but I need it to work on webgl1. Can shader graph shader ...
0
votes
1answer
38 views

How to make a pixel painting program using Unity

So I'm making an Android app/game using Unity where the user is able to "draw" by touching the screen. The drawings will be pixel art -- basically, a pixel art drawing function -- so ...
0
votes
0answers
26 views

How can I spawn a gameobject based on its rarity rate? [duplicate]

I want to spawn my obstacles based on their rarity rate (between 1-5). I am confused at how to handle the condition where random value equals to multiple obstacles with the same rarity rate. I thought ...
2
votes
1answer
33 views

How do you exclude (gitignore) assets from Unity's package manager without messing up the references in your project?

My assumption is that, in any context , it is not a good practice to keep libraries and packages in your source control. For instance, I have downloaded the "Platformer set" asset and ...
0
votes
1answer
37 views

Why doesn't my button work with Unity's New Input System?

I have decided to move from Unity's old input system on to the New Input System to control my mobile game. I am having some issues with buttons, especially the a ...
0
votes
2answers
36 views

How can I access a ScriptableObject from C# class?

I adjust my level settings in a Scriptable Object and I want to access that Scriptable Object from a non-Monobehaviour C# class. When I use ScriptableObject.CreateInstance<> method, I get ...
-1
votes
0answers
46 views

Rewarded Ads Button not interactable

I'm using Unity 2019.4.17f1 and Advertisement package version 3.7.5 as can be seen below. I enabled ADS in Services and Enabled test mode. I created an empty gameObject called AdsInitializer and ...
0
votes
1answer
44 views

How do I make an object bounce off the wall?

I am spawning objects at a random place at the top of the screen, tilted at a random angle like this: ...
0
votes
1answer
19 views

How to copy a scene in Unity?

When I use CMD+D on the current scene to duplicate and then I open the new scene, I get this error message: ...
-2
votes
2answers
34 views

Character Controller not colliding in Unity [closed]

I have a character controller on my player object however it will not collide with the terrain and will just fall through, what am i doing wrong. (PS I am really new to unity)
0
votes
0answers
23 views

Unity: How to deselect all options in a TMP Dropdown? Or alternatively have the currently selected option still trigger "On Value Changed" if clicked?

I am trying to build a menu system for my mobile app from TMP Dropdowns in Unity. In order for this to work as I am aiming, I need all options to be clickable and for clicking any of them to trigger ...
1
vote
0answers
11 views

Editing an InputField on mobile with the keypad open, it wont let me edit another field without loosing focus on the current 1st. How to by pass?

When I'm typing into a tmp input field on a mobile keypad, I can't instantly edit another input field by clicking it!? I have to click off the keypad to loose focus on the current before I can click ...
0
votes
1answer
38 views

How do I apply tiling and offset to a gameobject instead of material?

I would like to apply a texture to a plane. I want to assign a certain offset and tiling to it. The material has a Tiling and Offset option. However, I don't want to do it on the Material level. Why? ...
0
votes
0answers
11 views

Unity IAP .isSubscribed() is always true?

Unity IAP, latest Unity, latest IAP... it seems .isSubscribed() is always true? How does one find out whether a user has actually subscribed to an IAP product? <...
0
votes
0answers
14 views

List<Vector3> of line segments (start, end position) from jointed CapsuleCollider chain

What I'm trying to do I'm trying to create a list of positions which I can use to define a centripetal catmull–rom spline; however I can't think of a solution for creating the list of positions which ...
0
votes
1answer
25 views

How to recreate a comic book panel transition with my canvas (simple 2D background art)?

https://www.youtube.com/watch?v=Tqqf5Y8LyR8&t=23s&ab_channel=ErikLoyer So I want to achieve a transition like from the above video, specifically at 0:23 the TRACK, but there is a 3 Dimensional ...
0
votes
0answers
28 views

match-3 Board border

I'm new to unity and I'm currently working on a match-3 game. I know there are a lot of similar games and that's why I would like to know what is the best way to autogenerate border of a match-3 board ...
1
vote
1answer
34 views

Sprite won't flip properly

I have a waypoint script I use to control enemy patrol movement in a given area. I use a reference to the Sprite Renderer to change the sprite facing direction. It starts with flipX set to false, by ...
1
vote
1answer
51 views

Unity APK size is too big for building the same scene

I'm developing a game that should have 15-60 levels when all the environments of the levels are the same. I created a scene (level 1) and tried to build it; the total APK is around 38MB which is fine. ...
0
votes
0answers
29 views

Unity Editor takes long time to start

Starting unity editor (2020.3.20f) takes a minimum of 10-15 minutes even on fresh projects, Same thing happens with the Old (2019) and New(2021) versions. Even faced this issue in 2020.3.19f. I hardly ...
-3
votes
0answers
38 views

how to make a player run using bolt [closed]

I made a horror survival game I don't know how to make him run using bolt I suck at coding so I use bolt instead how do I make my player jump could some wan
0
votes
1answer
42 views

How to fix animation script so that humanoid character holds their weapon

I am trying to follow this tutorial video about setting up an third-person shooter character in Unity. But my character will not hold their weapon. I'm also getting the following warnings in my ...
0
votes
1answer
25 views

Input.GetAxisRaw not returning a 0 in Unity

this is extremely frustrating, basically Input.GetAxisRaw only ever returns a 1 or -1. see my code below ...
0
votes
1answer
37 views

How do I make sure the order of my vertices are always clockwise when creating new triangles?

In 2D I'm trying to insert a new vertex in my mesh and creating new triangles using that new vertex sort of like the red vertices in the picture shown: However, I'm having trouble with figuring out ...
0
votes
1answer
24 views

How to handle bloat that comes with derivative ScriptableObjects?

I have ScriptableObjects with special code functions that all are slightly different in their interaction, all derived from one main ScriptableObject. This has lead to making the ScriptableObject ...
0
votes
1answer
51 views

Show colliders in a build game in Unity

Is there a way to show all colliders 2D in a a released game at once? I am making a 2D game in Unity and have to show all colliders to the player. Can I use Gizmos?
0
votes
1answer
28 views

Why does Unity reload when I switch between branches in SourceTree?

I have decided to work with multiple branches (Art, mechanics, packages etc.) on SourceTree but I noticed that Unity reloads everytime I switch between branches and I can't access a prefab from ...
1
vote
1answer
60 views

Help on calculating distance between player position and other object collider end

So, imagine the drawing in 3d and obstacle is in front of the player, and I do a raycast for checking in front of the player and if the raycast hits the obstacle the player needs to check both left ...
0
votes
0answers
21 views

UI mask and elements not visible after Async scene change

i have an async loading scene system that redirects to a loading scene and then to the target scene. The function works properly although i found out that some UI elements dont work directly on scene ...
1
vote
1answer
27 views

Unity LoadScene did not seem to work properly

My logic is simple: after conditions are met, display an image (an Image class instance) and restart the stopwatch. After a certain time, reload the scene. In a <...

1
2 3 4 5
292