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
2 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 ...
0
votes
0answers
3 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
7 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
8 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
10 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
22 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
20 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
28 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
0answers
31 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
28 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
34 views

how to make a player run using bolt

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
40 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
21 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
33 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
22 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
41 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
24 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
53 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 ...
0
votes
1answer
25 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
votes
2answers
32 views

How to Spawn GameObjects at Random Positions in Unity? [closed]

Hello GameDev Community, I have a problem with this pice of code. If I start the "Game", it crashes right away. Probably is its the list of GameObjects or the foreach loop. I have no idea ...
1
vote
0answers
16 views

Handling Multiple Collisions for 2d Platformer

I am looking for ideas on how to handle multiple collisions. For example: currently if my player character lands on an enemy tagged object, a raycast handles collision detection for a seamless kill. I ...
-1
votes
1answer
26 views

Creating a background image with Photoshop for Unity

I'm making a home screen for my game. I don't know how to transfer a 2d image from Photoshop into a game that's on Unity. How do I import the image and make it visible in game? It’s a 3D game. I don't ...
0
votes
0answers
27 views

Unity IAP, Remove Ads Button not working correctly, Users refunded after 72 hours

I am facing a very annoying problem. Indeed, my game is monetized with ads and I added a button allowing users to pay a dollar to stop seeing ads. But for some reason, all the users get refunded after ...
0
votes
1answer
49 views

How can I make an object follow behind the player with respect to its rotation such that the player never faces it and always remains behind them?

Below is a sample of my current code. It doesn't even move the object at all. I thought I could first get the current forward y rotation of the player and then flip it to get the backward rotation and ...
0
votes
1answer
9 views

Optimization problem with tweening UI using DOTween in Unity

I read in a Unity blog post that using normal animation with UI in Unity is not really recommended, but instead you should use tweening if you can. To test this so I tried the same animation with both ...
0
votes
0answers
13 views

adding flying movements to Unity's NEW StarterAssetsInputs

I'm trying to add a flying feature to my character. I set up the Third Person Controller using the newest StarterAssetsInputs (capsule) which contains it's own ...
-1
votes
0answers
20 views

How to fix that errors during build

I have no idea how to fix that. Can you please help me?
1
vote
2answers
31 views

What is the correct approach to swapping between rigged models at runtime?

Lets say we are making an RTS and at runtime a unit can go from worker to soldier to baker to forester to male to female and so on, you get the idea. This requires several different character models. ...
0
votes
1answer
19 views

Unity IAP - Collection was modified; enumeration operation may not execute

In Unity, after importing UnityIAP Version: 2.3.0, I have a button to which I attached an IAP Button component like in the image below: My SkinsPanel class looks like this: ...
0
votes
1answer
37 views

why does my mesh render on top of UI?

I've got some UI elements and a 3D mesh imported from blender. I've tried stuff like sorting layers, so that I render my 3D mesh below a canvas UI element(side panel), for which I put my 3D mesh ...
0
votes
2answers
55 views

How to set a variable from the selected text of a dropdown menu in Unity?

I am trying to set a variable from the value of a DropDown menu in Unity. I wrote a script as follows, attached it to the dropdown and set it to run it in Unity under: On Value Changed (Int32). I have ...
0
votes
1answer
22 views

Change color in specific sections in sprite

I have a game, where I would like to generate multiple enemies, just switching randomly their skin and clothes, colors. One way to do it, would be to break every position (each position composed by ...
2
votes
1answer
67 views

How to make mouse pointer be the vertex of a drawn parabola when estimating the trajectory of a projectile?

I'm trying to remake an old flash game using Unity. The main mechanic of the game is to make the basketball pass over the mouse. Here's a video of the game: https://www.youtube.com/watch?v=6sArMC1l_Sc ...
0
votes
1answer
40 views

Making vehicle using WheelColliders faster

I have a driving game and use wheel colliders to control cars, but whatever I change with the WheelCollider components it doesn't get faster and is way too slow. The code of the controller: ...
0
votes
0answers
8 views

Fade in / Show unity lights only at a specific distance from a camera

I noticed that in URP point / spotlights are not initially visible at a distance and then they sort of fade in the closer they get to the camera. I am wondering if I can control this behaviour somehow?...
0
votes
1answer
29 views

On a UI element(Input field) and overlay canvas how do I find the very bottom middle pos of the UI using it's height from it's rect transform?

I'm trying to place one in our field right below another, all ui belonging to an overlay canvas. I tried doing a few different ways subtracting height from different position types including rect ...
0
votes
1answer
38 views

Asset Bundle download from server: how does one prevent scripted attack?

I am relatively new to how asset bundle works in Unity. Based on my learning, it seems one uses UnityWebRequest.GetAssetBundle to download an asset from a specified ...
0
votes
1answer
20 views

Unity - How to stop the slide on slopes?

struggling with a wee issue where if my character walks up a slope he slides back down when at rest, and bounces down when running down the slope. I've followed a few videos but none seem to address ...
1
vote
1answer
26 views

How to re-render the scene only when something changes in Unity?

I am building a social/chat/dating app which I would like to build in Unity as I want some 3D graphics, geo-location functions, and possibly mini-games you can play together with others. From a ...
0
votes
1answer
21 views

Why is my shader's call to UnityObjectToClipPos() causing my *other* shaders to be invisible?

I created a shader via a node-based shader tool called Shadero Sprite, and I'm trying to debug an issue with it. Since the code was generated by the node-based tool, I'm not entirely sure what the ...
0
votes
1answer
20 views

Unity make an Expandable Scroll List (adding elements) [duplicate]

I am trying to make a scrollable list with premade elements that you can add using a button. The problem is that the list's Content element needs to be exapanded as ...
0
votes
2answers
39 views

Rotating only 2 axes of rotation quaternion to "point" in a direction

Note: I am using the Unity DOTS ECS framework, which contains less maths functions, but I can probably implement the same functions from standard unity if the code is public. This question is not ...
1
vote
2answers
46 views

How can I keep a mesh connected and upright?

I'm pretty new to both programming and Unity, and I honestly have no idea how to accomplish what I want to do. Scene: I have a Sphere which I can control with my keyboard. It rolls around on a plane ...
0
votes
2answers
26 views

Unity keyboard state issue between scene loads

I'm facing an issue when loading scenes in unity. My game is composed of full screen levels where players exit to the next level when touching the edges. So, when the player touches an edge I load ...
1
vote
1answer
18 views

Odd behaviour when changing rigid body velocity inside OnCollisionEnter2D

This is the code I'm using to make an object bounce across the scene: ...
0
votes
1answer
32 views

What color format, depth buffer should I use in a RenderTexture for WebGL screen output in Unity? Is NPOT ok? MipMaps?

Today I learned about a technique for forcing uniform resolution in a Unity WebGL build, as described here in the answer by DMGregory. Yay! I'm experimenting with implementing this technique on a ...
0
votes
0answers
19 views

How to pass string from one scene to another in unity? [duplicate]

In the start Menu the player prompt to write his name but when the game start, the name does not appear on the other scene
2
votes
2answers
103 views

How to use different drag values for the X and Y axes on a Rigidbody2D?

I'm building a small 2D character controller using Unity physics to simulate an oldschool platformer. I know this is not the best way to do it and I have my own version using just raycast and custom ...

1
2 3 4 5
291