Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
1 answer
750 views

How can I create a pressure pad in order to open a door?

I'm making a 2D platformer with Unity and I'm trying to create a pressure pad to open a door. I want the door to open when the player is on the pressure pad and close a few seconds after the player ...
0 votes
0 answers
30 views

Issue when making the player face the direction it's currently going

I'm trying to make the player face the direction it is going, not facing up & down but only on the X & Z axis. Currently the player keeps facing only one direction, no matter which direction I'...
0 votes
0 answers
12 views

How to implement 3rd person animation with acceleration from walk to run?

I am new to Unity and I am using dr Penny de Byl's lectures on Unity. I am trying to use a Mixamo character. I downloaded a character with skin as an fbx file, and also added some character movement ...
0 votes
1 answer
26 views

Weird behaviors with transform.LookRotation when looking at position+Vector3

I'm working on a character controller for an isometric retro shooter. However, when making the character rotate towards where they are moving, I encountered some issues. The character doesn't fully ...
1 vote
4 answers
4k views

Tab between input fields

I am new to working with Unity3d, I need to navigate between several inputField, for this I have looked at the solution that is in: tab-between-input-fields, but ...
1 vote
2 answers
18k views

How to play an animation backwards in Unity?

I know this question has been asked before but it all involves using the Animation(?) component, so that is no longer any good in Unity 5.3.1f1, I explain a bit more later. I'm trying to simply get ...
0 votes
1 answer
883 views

2D isometric game with 3D prefabs

Is it possible to have a 2D isometric game in Unity, but also have 3D prefabs in the scene? Will that work or should I make the game in 3D with an isometric camera?
1 vote
1 answer
74 views

How to generate a series of checkpoints randomly along a 2D line

I was wondering how I would go about generating a series of checkpoint gates along a 2D line in my game. A bit of background, my game is a 2D reinforcement learning car driving simulator, I have a ...
0 votes
1 answer
675 views

Int vs Float, which one is faster for gpu?

My game need to loop through massive amount of data, and the amount of data can increase by a lot depending on world settings set by player. The data is too big for CPU so i need to use GPU for it ...
1 vote
0 answers
29 views

Quaternion.Euler acting weird

so I'm building up a simple arcade racing game and I was messing around with the Wheel Colliders setup. I was wondering if it was possible to add some camber adjustments in real time depending on the ...
0 votes
0 answers
12 views

Select polygon (and create submesh) by color of texture?

For a procedural unity mesh operation: What is a performant way to select polygon (and create submesh) by color of texture? Raycast hit a point on the mesh, then paint bucket search for the same ...
0 votes
1 answer
484 views

How to get reference to board tile object another game object is sitting on?

I am trying to get reference of the object underneath my Player. I don't know if I am approaching this correctly. Right now, I have a player simply put in the scene, like this: Then I am trying to ...
1 vote
1 answer
684 views

Random FPS drop with OpenGLES 2.0 on android, sudden white screen with Vulkan

I'm having a problem with my 2D game on Android. When I use OpenGLES 2.0 as the graphics API, I experience sudden FPS drops in the game. The game starts to slow down sometimes randomly, And it can ...
0 votes
0 answers
11 views

How to map different serverless logins (Facebook, Apple, Google Play) to one account in Unity CloudSave?

How can I map serverless different logins (Facebook, Apple, Google Play) to one Account in Unity CloudSave? Or is it automatically done when we are logging in via ...
0 votes
0 answers
22 views

Unity Grayscale camera but mask colors

I'm trying to replicate the example given in this thread: https://gamedev.stackexchange.com/a/185593/179264, and I was able to, but for now I want to implement the "mask" thing to 2d lights ...
1 vote
0 answers
50 views

How to make enemies navigate around each other in a grid-based game?

I am making a 2D top-down grid-based game where the movement is similar to older Pokémon games so it's locked to a grid. I implemented A* pathfinding for my enemies with a bool[,] that indicates ...
0 votes
0 answers
28 views

What is the best lighting & shadow setup for mininal draw calls and triangles?

I have been testing out various lighting and shadow settings in Unity since during play mode the stats are showing a much higher set pass call and triangle count to what I know my model has. I have ...
0 votes
1 answer
46 views

How do you make the camera not "Shake" when used with a rigidbody for 3D in Unity?

So I have no problem getting it to work with a characterController. It looks smooth when I walk/run/jump around. But I wanted to make it work with a rigidbody. There was no problem when I tried ...
0 votes
1 answer
792 views

How to spawn card sprite

I have a card sprite that I would like to spawn at a specific transform position but can't get anything to appear My Code - ...
4 votes
2 answers
2k views

How to orient hands(or spine) to always look at some target?

I am building an FPS game in Unity 3D everything was going cool but when I tried to implement aiming for the rifle everything just broke. 1): I have an IK setup which triggers when you equip weapon, ...
0 votes
1 answer
61 views

Collision matrix is set to have no interaction between layers, but collider still triggers

I wanted to set up the layers that my Player interacts with, but it still triggers with unwanted layers. I have disabled the whole collision matrix in project settings: Here's my Player settings: ...
0 votes
1 answer
623 views

How to check if one object's local bounding box contains another

I am currently trying to check whether the first object contains a second. I first tried to use the bounding box, but it is defined in world space, so it is not working with my rotated cubes. Then I ...
0 votes
0 answers
25 views

Player-Environment Interaction & Collision Handling in Unity

Simply put, how would you go about designing environmental interactions? For example, upon pressing the interact button when near a chair, he can sit on it. (Also works with NPCs functioning with <...
1 vote
3 answers
71 views

Unity/URP global volume with volume mask still applies effects to all layers

I simply would like to apply the Global Volume only on specific layers but I probably misunderstood how it works. Environment & Inspectors GameObject\ ...
0 votes
1 answer
314 views

Rotating certain particles in a particle system in Unity

I'm working on a visual effect using particle systems. I'm trying to rotate newly created particles according to some object's velocity at that time. Currently, I'm rotating the entire particle system ...
5 votes
1 answer
1k views

How to rotate a parent object while rotating a child object to a certain angle using coroutines

I have a semicircle like game object which I made by putting two arcs in an empty game object (SCircle) and rotating the 15° (for left arc) and -15° (for right arc) as seen below. ...
0 votes
0 answers
48 views

Only 1 out of 3 Animator components react to trigger event

I have a main menu in which I want buttons to play an animation when they are held pressed and only fire it's "OnClick()" event when the animation ends. (So it's reset if you do not hold it ...
1 vote
1 answer
615 views

How can I attract & repel the mouse cursor from particular UI controls?

This question came from some of my students. I wanted to share it here so others can find & improve on the solutions we've found so far. In particular, my answer below doesn't behave as well as I'...
0 votes
1 answer
33 views

In Unity if you use Destroy on a GameObject and then immediately change the GameObject value, which GameObject gets destroyed?

Since Destroy happens after the update cycle, I wonder if you could accidentally (or intentionally) change what gets destroyed since you can still have code execute after calling Destroy. For instance,...
0 votes
1 answer
24 views

Trouble with NetworkDriver.Create in Unity Networking

I'm encountering an issue while using the NetworkDriver.Create method in Unity Networking and I could use some assistance. Here's the code snippet where I'm facing ...
0 votes
0 answers
9 views

How to fix UVs of spline tunnel/cylinder mesh?

I have created a tunnel using unity's spline tool. And I'm creating a custom shader for it in shader graph, and I would like to add bumps inside of the tunnel. The problem is in how the UVs, vertices ...
0 votes
1 answer
46 views

Call to Random.Range() is breaking my prefab instantiation

This is for a simple sidescrolling game. I want to have it so that when an enemy is killed, it has a chance of dropping a health collectible for the player. I wrote a separate simple bool method ...
0 votes
1 answer
461 views

Create 3D line instead of a thin line in Unity in runtime with mouse drag

I know how to use line renderer to drag and drop to create line in runtime, but the line appears to be thin when looking from the end of the line, I want to create a real line that has a thickness(...
0 votes
2 answers
512 views

Can't submit facebook app for review

I'm trying to submit my app for review with publish_action. I keep getting the following error: "It looks like you haven't made any API requests to access content with the publish_actions permission ...
1 vote
1 answer
63 views

Rotating around Wall Corners while Climbing

So I've posted here before regarding a Spider-Man like game that I'm working on. I'm facing another dilemma now. I want to rotate the player around the edges of walls. So far, I've implemented a ...
1 vote
0 answers
18 views

Unity Animation Rigging Override Transform is not affecting rotation on startup

Given: I have animation of character arming the pistol using IK. The pistol In Character's Idle State is on the characters hip and it's barrel is looking at the floor. Next I have armed state when ...
2 votes
2 answers
34 views

How to ensure smooth animation when making spline longer?

In Unity, I have a Spline that I'm using to move an object. During the game, the player can add new knots to this Spline as the object moves forward. e.g if they want the object to go right, they can ...
2 votes
1 answer
473 views

Trouble GamePad input on iOS but works perfect on Android

I am having trouble getting input from on iOS devices (iPhone 6 Plus and iPad). Here is my code, ...
0 votes
1 answer
14 views

Selection Box Not Positioning Correctly

I found some code that generates a selection box, but when I tried it the box was not starting where the mouse was and I couldn't find the issue. ...
0 votes
2 answers
52 views

Getting the Player to Face Movement Input on the Z-axis

I'm working on a Spider-Man like game and I've run into a problem. Whenever I'm near a wall and press the w key, the player starts climbing the wall. But when on the wall, I want it to face the ...
1 vote
2 answers
1k views

Unity Spline Animate reset the position when change the speed

I am exploring the Unity Spline package, and within the package, there is a sample scene called 'splineAnimate' where the SplineAnimate script is used to move an object along a spline. The script has ...
-2 votes
0 answers
38 views

How do I control the rendering of each sub-pixel in each frame in unity

I now want to compose an image where the sub-pixel values come from a different render texture. How do I control the sub-pixel composition for each pixel point in shader?
0 votes
0 answers
16 views

How to update a component field for a single player for all player views?

I'm making a 2 player game in which, when 2 players are in a room, they "toss a coin" to decide which of the two player "skins" they get. Now, the way I built the player "...
0 votes
1 answer
1k 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
2 answers
2k views

Syncing & smoothing movement with rigidbodies with Socket.io

I am building a 2D top-down MMO that's very lightweight. I have a master client that determines everything's position and actions, and sends this information to all other clients. Now I have made a ...
0 votes
0 answers
12 views

How to use a key to stop playing the current animation, and replay it from the beginning?

In my Unity project, I tried to use a key to stop the current animation and immediately play it from the beginning again. I also tried to control the delay before I can press again. The following ...
0 votes
2 answers
469 views

How to set GameObject on tilemap through script

In the built in Tile Palette tilemap editor, you can choose a GameObject brush to set custom tile GameObjects. How would I be able to set a gameObject onto a tile through a script?. There is no ...
0 votes
1 answer
557 views

Gameobject not spawning in desired position after InvokeRepeating and Instantiate

Context Hello, currently creating a clone of "Crossy Road" and what I'm trying to do is to spawn my moving object called "Vehicle" at a random speed and rate of spawn. This is also ...
0 votes
2 answers
108 views

Unity Navball x,y,z rotation axis' are not tracking main object

I am trying to figure out how to solve this issue. My navball is tracking the ship's rotation incorrectly as shown in the image. When the ship rolls (Z Axis) to the right, the navball rotates down on ...
0 votes
2 answers
46 views

Can you somehow use underscore to ignore different results in Unity like you would do with TryParse?

So I may not be the best programmer, but I am not a beginner. So in C# when you want to check if... lets say if its a number or not, but you dont care about the result(the you could write something ...

1
2 3 4 5
329