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

How to rotate and move an object in precise time fram

My task is to rotate and move an object into a new position and rotation in a given time. Say I have to move a cube from (0,0,0)|(0,0,0) to (1,1,1)|(0,90,0) in 5 seconds. Could anyone explain to me ...
1
vote
1answer
652 views

How to write a PBR Unlit Shader in Unity?

I have a REALLY specific case here: I have an Texture (a webcam), that is used by a shader to pickup a few x,y colors at the cordinates, and renders to a ...
0
votes
0answers
6 views

Is there a way to layer 2D assets in Unity while maintaining correct player clipping?

I'm working on a 2D top-down game, currently building a scene where I want to place one asset on top of another (lamp on top of table). Game objects are all on the same layer as the player so that the ...
0
votes
0answers
14 views

Changing transform.position doesn't move object in Unity [closed]

I am trying to perform the simple task of moving an object by changing its transform.position and simply can't get it to work. MoveTowards seems to do nothing ...
3
votes
1answer
199 views

How do I get an object to rotate in world space via RigidBody.AddTorque?

I'm getting really discouraged because I can't seem to figure how how to rotate my object via Rigidbody.AddTorque like it is on a figurative global turn table rather than a local turn table. Another ...
0
votes
0answers
9 views

How do I use triggers with animation layers?

I'm writing a third person controller with animation layers. The "Base" layer controls the lower body (idle, forward and backward movement). At idle, the character holds a pistol like this: ...
0
votes
2answers
472 views

SerializedProperty to UnityEvent in a Custom Editor

I am making a Custom Editor for a type that includes a UnityEvent property. I'm currently facing an issue in converting a SerializedProperty to get that UnityEvent. Here is how I declare the event ...
0
votes
0answers
9 views

Exporting scene during gameplay to FBX

In Unity is there a way to add a menu button during gameplay that allows the player to export the current scene as an fbx file? My googling and research shows that its possible to do this while ...
0
votes
0answers
19 views

How can I use 3D Ripper DX with Train Simulator 2020? [closed]

I'm working on some projects involving trains and I bought Train Sim 2020 (and some DLC) for research. My project will be made from scratch in Unity, but I wanted to extract some models from TS2020 ...
0
votes
0answers
23 views

Can I record Unity3d video running app on a server and launching it via command line? [closed]

I've created a Unity3d environment world where user can upload via website, some elements (photo, audio..). I want to host my Unity3d application on my server. Running the app , a pre-configured ...
0
votes
1answer
14 views

Unable to add AR session

I am new to unity and i am trying to make a AR app. I have installed AR foundation, Arcore Xr plugin, Arkit XR plugin via package manager. Then if i go to the Hierarchy panel to add a AR session and ...
1
vote
1answer
91 views

When setting Rigidbody.isKinematic true collider won't work anymore

I have a rigged 2D character and used Collider2D/Rigidbody2D/HingeJoint2D to body parts to implement ragdoll. It works fine, but I needed to run ragdoll physics only when character is dead. So I made ...
0
votes
1answer
26 views

Sorting layer issue with multiple sprites and a Tilemap in Unity

I have a particle system that draws a blood splat. I have a Tilemap that represents terrain. However, the blood splats, which are on a sorting layer in front of the terrain, are somehow rendered both ...
0
votes
1answer
40 views

Which functions does an animation event call?

I have an animation with animation events in an imported .fbx file. I spent some hours creating a class with delegates so that I could trigger methods on any C# class I wanted. Now I wonder if that ...
4
votes
5answers
30k views

What are the steps to instantiate a button in Unity?

Given a Canvas test_canvas containing a Button test_button and an empty GameObject that manages instantiation and scripts and ...
0
votes
1answer
30 views

Character bobs when moving

Whenever I try to move a character in unity, the character kind of, like, bobs around when walking. Is there any way to remedy this? I have tried the trick of putting the inputs into update and the ...
1
vote
1answer
20 views

Problems with gravity and box colliders in Unity 3D

I have a game character that can jump or roll in order to avoid obstacles. He is able to roll while on the ground and he can also roll while he is in the air after jumping. Everything was working fine ...
0
votes
3answers
53 views

World rotation independent mouselook

Preface: I am terrible at using quaternions right. I wanted to create a world rotation independent mouselook script. That is, no matter the 'down' for the camera, the mouselook should feel natural to ...
0
votes
1answer
15 views

apk is fine, but when building aab for google play submission google play services dont start when i download it

So I have a game on app store, I added Google play services Now when I do an apk build and test it works great really happy with it. But when I then tick the box for aab ( this is what Google store ...
0
votes
0answers
11 views

Unity 2D Weapon Attack/Weapon Switcher Architecture Question [closed]

I have multiple questions in this thread so please bear with me in answering to any parts that you may understand/know. I will try to number each of my questions to the best of my ability. Thank you. ...
18
votes
1answer
2k views

How to support Surface pens in Unity?

Our game works great with touch or mouse, but the Surface pen doesn't seem to register as a pointing device at all. How can we support the pen in Unity in a native build? This question on the Unity ...
0
votes
2answers
65 views

How to use AddForce on a capsule?

I created a simple scene, with a box that serves as the ground, and a capsule that serves as the player. I added to the player a RigidBody, and a component that should move it using AddForce: ...
-1
votes
1answer
36 views

How to set ScriptableObject by an int? [closed]

I am making a situation based game, where every situation is a ScriptableOI've made a save&load system, following Brackeys tutorial on that. I am saving all the data I need, and loading it ...
0
votes
2answers
29 views

Sprites lose quality when in Unity

Whenever I drag a sprite sheet into unity, it, for whatever reason, distorts. Is there any way to remedy this? Original Distorted
0
votes
1answer
16 views

Joystick servo control axis value when idle (unity)

When the joystick servo control is idle (user not moving it) , i don't believe the axis value will be 0 because there's a lot of thing that interfere with the value (such as calibration , inaccuracy , ...
0
votes
2answers
3k views

Unity RigidBody2d.MovePosition() not working on dynamic rigid body

As it says, .MovePosition() won't move my character. I know other ways to move but I want .MovePosition() in particular as I think it will solve the camera's jittery movement when the player pushes ...
1
vote
1answer
65 views

Throttling or adding delays between OnTriggerEnter2D calls

I have 2 game objects: Explosion and Enemy. At any given point, an enemy can collide with multiple ...
0
votes
2answers
39 views

Switching between world and battle scene with no or minimum loading?

I am making a strategy game where the player roams a grid map. When the player encounter enemy on the map he is transferred to a "battle" scene where two armies are fighting in turn based ...
1
vote
1answer
246 views

Unity's LODs by distance to the orthographic camera

I'm trying to do something that I thought was simple, but seemingly it's not that easy. I understand that Unity's LOD system works by refering to a percentage of screen size that objects occupy. That'...
0
votes
0answers
7 views

Unity 2109.3.4 apk fails to install on to quest

Hello's I was able to successfully sideload APK's on to the quest for a while now however when I updated to unity 2019.3.4 side quest is now unable to successfully load a built APK onto the oculus ...
0
votes
1answer
14 views

Unity hangs when saving prefab asset

For game saving purposes, I'm keeping track of references to ScriptableObjects through a lookup table, so that I can serialize/deserialize using the SO's position in that table. I have a lot of ...
0
votes
2answers
23 views

How to calculate a movement Vector3 to kill unnecessary momentum and start moving in the right direction?

Imagine a rocket is accelerating in a straight line toward PointA, picking up momentum every frame, then suddenly decides it wants to go toward PointB instead. It can't just turn straight toward ...
0
votes
2answers
51 views

How to rotate an object based on the movement and angles of Lifters

I have Lifters that "carry" an object. I want the object to move and rotate based on how those Lifters move. Requirements include: Supporting 1-4 Lifters at any side of the Object (e.g., ...
0
votes
1answer
16 views

Managing AI state transitions in Unity

I am building a horror game in Unity, and I am trying to make an enemy movement controller. The way it works, is the enemy has two states, made available via an enum...
0
votes
1answer
12 views

Unity AI issue with recalculating NavMesh at runtime

I am using Unity NavMesh to control my units. I am running into an Issue when updating Navmesh at runtime, It seems agents re-calculate their path whenever it is modified, which makes sense, but it ...
0
votes
1answer
37 views

How do I create a laser pointer dot in Unity URP?

I want to replicate the laser pointer dot as in RE4: Here is a video that shows the laser in action. I have tried to replicate it using a spotlight. The problem with the spotlight is that its size ...
0
votes
0answers
20 views

Changing handedness coordinate system between unity and opencv

For my problem given System A, opencv and unity. I have the Inversed extrinsic parameters in the "System A convertion". Intrinsic parameters (Can form into projectionMatrix) in the "...
1
vote
1answer
4k views

Can I use flat shading on a generated mesh?

I tried to generate a mesh from code in Unity. The problem is, that the edges are automatically smoothed. When I import a model into Unity, I can set the smoothing angle of the edges, but is something ...
1
vote
1answer
42 views

Draw calls in Unity 3d

I have only 20 materials in my game (19 are made with textures atlas). But the Setpass call is 72. I don't understand why. I want to know how to decrease the number of SetPass call. This is a brief ...
0
votes
1answer
19 views

Find the current player instance from multiple scripts

I have the following code used by multiple classes (e.g. Enemy, Scenary, EnemyProjectile etc.) in my game, which seems intrinsically wrong. What are some ways I could write this code once and use it ...
1
vote
2answers
55 views

Make Render Texture distorted/blurry?

I have created a function that clicks images in real time and these images are copied to render texture that is created. I am looking for a way to blur/distort/half-fade-out the render textures. Is ...
0
votes
1answer
34 views

How to build a game for linux in unity

I made a game and uploaded it to a game site. I exported the build as windows mac OS and Linux. My thinking was that it supported all of those platforms but i guess not. Someone commented saying that ...
0
votes
1answer
31 views

Advantage of Using Addressable Over Asset Bundles in Unity

i have a project that already uses asset bundles. i download assets in start of the game and show them to users anytime needed. i see that unity provides addressables as new solution for asset ...
0
votes
1answer
126 views

Hide “No custom tool available” window

I have this annoying window in the bottom right of the scene view. From the manual, it seems like I opened it by clicking on the wrench & scribe button next to the movement buttons. How do I ...
0
votes
1answer
25 views

How can I get the speed of finger drag using unity TouchPhase.Moved?

I'm making a mobile game where you control a 3d ball by touch. So far I can get it to roll based on finger down and drag (via TouchPhase.Moved) but I want to be able to detect a fast flick or finger ...
0
votes
0answers
7 views

Object destroyed when applying WebCamTexture across Photon

This script turns the texture from WebCamTexture into a byte array to send across Photon as an RPC. However, when it is called, it displays the WebCamTexture for 1 frame before destroying the entire ...
1
vote
2answers
105 views

Is it bad form to use singletons in unity [closed]

I've heard a lot of people say singletons are bad practice and an 'anti-pattern', like here, this answer this article and here. However, a lot of the reasons I've read about seem to be to do with ...
0
votes
2answers
26 views

prefab editor not working for NGUI in unity2018

i just updated my project from unity5 to unity 2018. my project uses ngui as UI solution. eveything works fine in updated version but when i want to edit prefabs in prefab mode i get this message: is ...
0
votes
2answers
28 views

Set a minimum distance with navmeshagent

I am totally newb. How to set a minimum distance between AI chasing a player if AI has navmeshagent ...
0
votes
1answer
40 views

How should I manage my data that needs to be associated with rank (Unity)

So I am making a game with a similar content progression to Clash Royale. Essentially u have ranking points (Identified as Trophies), and the number of trophies you have will determine what content ...

1
2 3 4 5
251