Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
18 views

Unity apply materials to parts of a mesh

How can I apply materials to a part of a mesh in Unity ? As an example I would like to place grass on the first half of a plane and rocks on the second. And if possible, how can I manage transitions ...
0
votes
0answers
17 views

Why are the collision contacts different with diffferent gameObjects?

So I have two different colliders colliding with the same gameObject, let´s call it object S. If collider 1 is the one colliding, collision contact points are on the the edge of object S. However, ...
0
votes
1answer
44 views

Remove hidden values within string

I tried removing the Unicode Whitespaces in the string using words[len].Trim() but still there's still an extra character. Every letter represents the coordinate ...
0
votes
1answer
94 views

How can I develop and publish a game when I don't have the money to buy a brand new computer?

I'd like to complete and publish a game made with Unity, but given the fact that the cost of a brand new computer represents a significant part of my yearly income, I don't have enough money to buy ...
0
votes
2answers
38 views

Unity3D Build Configuration for Deployment/ Publish

Is there the option within Unity3D to specify build configurations? My goal is relatively simple - when building for mobile stores (Play Store/ App Store) I want to make sure my app is pointing to ...
0
votes
0answers
32 views

Raycasting - how to properly do reflection and refraction

I am developing an application for Microsoft Hololens, which should visualize reflection and refraction of a light beam. I use a virtual GameObject as torch (movable by the user) and do a raycast in ...
0
votes
1answer
25 views

Why do I get this weird shadow render error?

Using Unity 2018.2.14/15 I've recently been working on a small project and I encountered a very weird problem. It's hard to describe so here is a picture: Originally I assumed it may be an issue with ...
0
votes
0answers
47 views

the snail makes a weird behavior when the player push it

I have a problem when I push the snail when she is stunned and at the same time when the player moves to the snail, the snail makes a weird behavior. could you help me solve this problem or just tell ...
0
votes
1answer
49 views

Creating structure to a game (Missions, Dialogue, Triggering events upon items collected, etc) & monitoring the progress of a player in our code?

Hello all I have been working with Unity and other game engines/libraries for many years in my spare time. It's been a long twisty road full of joy and pain :D In the last few months or so I have been ...
0
votes
0answers
31 views

Problem with hard edges alpha channel in sprite Shader

I was looking for a shader which can apply a texture on the sprite and tile it based on its world position. I found example of shader from here. It works well, except the alpha channel breaks down ...
1
vote
1answer
40 views

Calculate heading required to turn ship so that its weapon can fire at target

I have a ship, the ship travels towards a heading (vector3, blue arrow) with an arbitrary speed. The ship has a weapon on the side, the weapon can point in any direction, except straight forward/...
1
vote
0answers
17 views

Fitting Gameobjects within camera view

I am trying to fit a grid of gameobject into the orthographic view but I have a problem whenever I change the amount of grids to display it would overlap the view. What cαn I do to fit a series of ...
0
votes
1answer
32 views

Difference between Unity's [Command] and [Server]

[Command] and [Server] functions both run on the server and can also be called by a local player but what is the difference between them?
0
votes
0answers
10 views

Animation type changed from Generic to Legacy; animation clips now irretrievable

I imported an .fbx file with the 19 animation clips: Originally, the animation type is Generic, with the following properties: ...
0
votes
0answers
46 views

How to properly squeeze an object when is being pressed based on percentage of collisions in relation to scale?

Am trying to do this: How can I "squeeze" a game object when it is pressed between two others? Which has anwsers, but with some issues, like not lerping back to original scale or not ...
1
vote
0answers
71 views

How can I make 2D fog like in Graveyard Keeper?

I really like Graveyard Keeper's fog effect but I can't work out how to make it. It's 2D, and made in Unity. The characters all seem to be 'under' the fog, but the tops of tall trees and buildings ...
-1
votes
0answers
17 views

Tile-Based Obstacle Storage

I've been developing my first 2D platformer using Unity's tile editor. I created a few sprites that I'd like to use, but I'm unsure on how I could add them to the game while still keeping things ...
0
votes
1answer
16 views

Contracting Unity EditorWindow UI

How can I make scalable(contracting) EditorWindow UI(not in-game UI) like in inspector example?
0
votes
0answers
18 views

serializedObject.ApplyModifiedProperties() returns false

I got a problem with saving my modified ScriptableObject. The ScriptableObject itself contains only primitive types (int and bool). After modifiying these values using the Custom Editor Script I wrote,...
0
votes
1answer
35 views

Preventing overlap in OnCollisionEnter2D

So I have successfully built a script that can determine the physics for a ball reflecting linearly off of walls, similar to pong, while the ball is using a kinematic rigidbody. The issue is when the ...
0
votes
0answers
32 views

How can I instantiate objects with gaps between all objects?

When instantiate each a new object I want it to be with the same gaps from also the other instantiated objects. ...
1
vote
1answer
18 views

How to filter list of all objects in Unity project, by their type?

I want to filter the list of project objects in unity, and view all objects of specific type in the project. (by type, not by name) How can I do that?
0
votes
0answers
17 views

Object reference not set to an instance of an object [duplicate]

I have made my camera a prefad and since then I am getting the error Object reference not set to an instance of an object PlayerController.Update () (at Assets/Scripts/PlayerController.cs:34) which is ...
0
votes
0answers
16 views

Why is it when I grab at a point it “jumps” upward?

So I've got a mechanic that lets me grab vertices. Something in my code (I think it's got to do with the clickRadius) keeps causing a grabbed vertex to "jump up". Example: https://i.imgur.com/0S6ZyRK....
0
votes
1answer
46 views

Using Reflection to access an array from a ScriptableObject in Unity

I am trying to get access to a set of stored variables inside a scriptible object in Unity. This class (SectorDeclaration) has a method to pull a variable with a string of the variables name from it: ...
0
votes
1answer
40 views

My character jumps, stops and if I try to jump it jumps!

There is this thing. I have Coded to check if my character is grounded. And it works fine. But problem is that I have added a code to jump. When my character jumps while checking my character is ...
0
votes
1answer
47 views

18.5:9 Android ratio force to 16:9 problem in Unity

I want to my game build in devices with 18.5:9 ratio like Samsung S8 forced to be displayed as 16:9 ratio. I already set Aspect ratio mode to Custom and set it to 1.86 in Player Settings. I also ...
1
vote
1answer
38 views

OnCollisionEnter2D just flat out not running for certain objects

I am working with the Unity3D Engine in 2D mode. Currently I am trying to make a circle collider bounce off of a composite collider for the walls of my game. The only issue is that for some reason the ...
-1
votes
2answers
47 views

How can I change member variable when it's passed as an argument to a method?

I am trying to use the unitConverter method below to change the values of u1_1SCost and ...
1
vote
0answers
26 views

What are efficient strategies to support alternate spritesheets in Unity

Context Let's suppose a classic card game, designed in Unity (say the latest release as of now, so 2018.2.16). Visible cards are GameObjects with ...
0
votes
1answer
23 views

Top down off-screen indicator, Unity3D C#

I'm working on a top-down 3D game where things spawn off camera. Movement only occurs on 2 axis (x and z). Rotation is about y axis. The player is in the center of the camera and needs to have ...
0
votes
1answer
23 views

Player object's model starts to shake after some time

I created a default scene in a new project and imported a model from Unity's asset store and then get this strange behavior of the model starting to shake for no reason after some time after starting ...
0
votes
0answers
30 views

How to use loops in Unity Job System

I want to calculate the distance between the list of game objects So element will check its distance with every other element and so on, I am doing this with following code it works but not efficient ...
0
votes
0answers
17 views

Can a [Command] be sent only from a player object?

I have a query about Unity Networking. As the Unity documentation says: Commands can only be sent from YOUR player object. My question is, if I have multiple scripts which are using ...
0
votes
0answers
31 views

Unity3D: Can I simulate input so that input.GetKeyDown event evaluates to True, without physically pressing a key?

I am aware that I can use User32.dll hooks or the InputSimulator, etc. However, I am wondering: does Unity3D provide a way to pass a key (eg space) to the input ...
1
vote
1answer
28 views

How can I detect when the formations of units are broken? - Unity 2018.2.x

Sorry if I don't write this properly, this is my first post here. I am working in Unity 2018.2.xx I have an issue where the current solution for checking whether a squad formation is broken. For ease ...
2
votes
0answers
34 views

Line Renderer 2d Follow the edge

I am using mouse position to draw a line using line renderer 2d. What i want is when the line hits a collider it should start to draw on the edge of the collider rather than over the collider. ...
1
vote
1answer
29 views

How to create temp folder to store a file from external directory and use it in a game

I would like to copy a 3D model from external library and save it in temp/Resources/StreamingAssets folder to instantiate an object in unity scene. ` ...
0
votes
1answer
20 views

How can I set AnimationCurve by script?

In the top of the script: public AnimationCurve curve; Then the object in the editor have AnimationCurve but without any curve yet: I want to set one of the ...
1
vote
0answers
36 views

Piece of code causes game to freeze, then keep playing after sometime

Games Basic Premise Ball rolls along procedurally generated path. Click to changer directions. Don't fall off. I have a script dedicated to the path. The path is made up of 20 cubes, along the x+ and ...
0
votes
0answers
21 views

Raytracing infinite hair strand in modulo space (curly version)

I'm working on a hack for hair rendering, I basically trace modulo voxel to get infinite grid intersection. It's basically a division from the entry point to the hair center using the delta of the ...
0
votes
1answer
33 views

Unity3D C# Drag object smoothly on it's x axis that's already bouncing

In my scene, I have a bouncing ball that collides with a cube. On each collision the ball returns to the same height. How can I get the ball to smoothly move along the x-axis by dragging my finger ...
0
votes
1answer
82 views

simple 2d car AI unity

I have a top down Car Game. how can I implement AI for the Cars? how the car follow the way points? I want AI cars also rotate itself along the path. I tried this solution ...
0
votes
1answer
49 views

How can I make Matrix Rain?

I want to make 3d Matrix rain like this shader that you can rotate camera.I tried to convert this shader but It have many calculations that it's expensive inside game engine.then I tried to make this ...
0
votes
1answer
51 views

Changing transform of ParticleSystem makes it not play?

Unity 2018.2.9f1, only 1 script, there is no other code. The scene is very simple (I just started). I'm working on a mobile game and I'm trying to play a particle effect at the tap location. I ...
0
votes
0answers
14 views

Smoothing random noises with different amplitudes

I have a function that returns a bounded noise. For example, let's imagine that out input range is [-1, 1]. With my method I can return a bounded/in range noise (depending on the biome we are ...
0
votes
2answers
63 views

The second double jump animation doesn't finish before the player touches the ground

I have an issue with double jump for the player my code is working but I want the second double jump animation finish(idle Animation: anim.SetBool("Jump", false)] before he touches the ground can ...
0
votes
1answer
33 views

How can I move objects in a cyclic loop?

I have number of objects I want to move them up and forward then when the last one each time in the array get to the end position move this object to the start of the array and to the start position ...
0
votes
1answer
44 views

Resize rigidbody in runtime, Box collider OnTriggerEnter not work

Scene setting: Object A: Rigidbody, kinmeatic Box collider, is trigger true. Object B: Box collider, is trigger true. Script is on Object A: ...