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.

learn more… | top users | synonyms (1)

3
votes
2answers
85 views

How to make sure Sun Shafts are emitted only from background elements?

Currently I have a game scene entirely made of standard sprites using the default material. I use the Unity standard effect named Sun Shafts. I have tried many combinations of shaders and other ...
-2
votes
1answer
55 views

Unity and Linux [closed]

Is it slow to run unity with wine? And are there any plans for unity coming to the Linux platform. Since i now that it can create a build for Linux i wish it was coming for Linux as well.
2
votes
2answers
154 views

C# 2D Enemy Follow Y Axis Only While Rotating to Look At Player (Unity)

I have a 2D game where the player can move up and down on the y axis, I need the enemy to rotate to look at my player (which I have working, but probably isn't the best method) while also moving up ...
-2
votes
0answers
21 views

Clamping camera and smooth pan back to target.transform?

I'm looking to have a camera move horizontally, but clamped on the other two axis. Also, I would like, during the horizontal panning, for the camera to have a short delay before smoothly fixating back ...
2
votes
1answer
48 views

How can I grab the script component of a collided object without knowing what script it is?

CalculateDamage() is an animation event called at a point during the character's animation in my 2D game. The commented out code is before I realized that not all of my pirates will be of class ...
1
vote
1answer
149 views

Kart Racing Attack AI

I am developing a kart racing game. In it, the players fight with each other while racing. There were several ways I tried to add attack AI to the enemies and the player. When the user clicks on ...
5
votes
2answers
139 views

How can I tell how much of a “scratch card” has been revealed?

I have developed scratch card effect.I am now working on reward system, so my question is how will I go on and implement logic which will let me know that the object behind scratch card is now ...
2
votes
1answer
105 views

Changing animation speed at runtime

Is there a way in Unity to change the animation speed of an animation managed by an animator controller (Mecanim)? I'd like to do that at runtime so that I can speedup and slow down an animation ...
0
votes
1answer
67 views

Efficient modification of Texture2D at runtime for a 2D painting game in Unity3D

I have spent some time looking for different solutions to be implemented in a mobile painting game I'm creating. At this time, everything is working but I have some serious performance problems on ...
0
votes
1answer
33 views

Unable to stop navmeshagent for rotation before moving

I'm trying to get the NavMeshAgent to rotate before calculating a path and proceed walking. I stumbled upon a thread that said this can be done by manually rotating the object first. However, I am ...
0
votes
1answer
268 views

8 ball pool scratch card effect logic [duplicate]

how to replicate this type of scratch card effect in Unity3D considering its for mobile. https://youtu.be/6wLWu1BefXs Two cases 1. Clear part of screen where user touches. 2. How to trigger rewards ...
0
votes
3answers
61 views

putting a delay between animation looping

I've got a player swinging a sword, this animation is controlled by a state machine. However, I don't want the player to be continuously swinging the sword when he's attacking -- I want him to swing ...
0
votes
3answers
83 views

player moving continuously from button controls

I added new buttons in my game made with unity 5.0 and the new UI feature. The player keeps on moving when button is clicked instead of moving just once. In the normal controls I make it move only ...
3
votes
2answers
84 views

How do I integrate drag over distance?

In my game I want to model kind-of-accurate bullet physics. I have the following drag equation (in C#): float drag = 0.235f * density * velocity*velocity * Mathf.PI * sizeMM*sizeMM/4000000; In ...
4
votes
2answers
138 views

Discoordinated Chromatic Aberration Effect

The game Teleglitch heavily utilizes the CA effect with screen distortion. I am trying to achieve this effect. Issue 1. How to not apply the effect onto the floor? (solved) They render the screen ...
1
vote
1answer
27 views

Aspect ratios for sprites in Unity3d

I'm using Unity3D version 5.0. I'm wondering what the best way to deal with changing resolutions in Unity is. In Swift I can just use the @x2/@x3 in order for it to pick the correct sprite for it ...
0
votes
1answer
34 views

How to make the capsule collider that comes with character controller follow the animations

I'm making a 3D endless running game like subway surf. When I swipe/press down arrow the slide animation starts but the capsule collider isn't following along as it doesn't slides along with the ...
-4
votes
1answer
42 views

How to I Create My own 3d modals in unity5? [closed]

How to I Create My own 3D modals in unity 5? Actually,I don't know how to create a 3d modals in unity 5.If anyone is know, PLZ tell me...!
1
vote
0answers
13 views

File Path conflicts on GitHub with Unity

I am getting file path errors when a contributor is making commitments to GitHub. All of these errors are file path related or extra white space on the same lines. This should be something in the ...
0
votes
3answers
95 views

Health bar - calculating health bar's position from percentage

I'm making a simple health bar in Unity 3D. Health bar UI is made from images. I'm having a problem with setting bar's position based on health percentage. Here's a script part: percentHealth = ...
2
votes
1answer
67 views

Stop Camera up movement

I am developing 3D game , the main camera is child of player. When player jumps camera too gets move up with player as its child of player.Is there anyway to stop this behavior? The only thing I can ...
0
votes
2answers
27 views

Getting unit to complete rotation before moving?

I've been trying to get a unit in my project to move in a fashion similiar to that of modern MOBA games. However, I am faced with the issue of the unit moving before the rotation is completed and the ...
0
votes
1answer
39 views

What is the difference between a game object being disabled and it made inactive?

I am looking over a script that has a particular function called to disable the script and mark a list for re-structuring: void Disable() { gameObject.SetActive(false); isEnumerated = false; ...
0
votes
1answer
19 views

Unable to get object to rotate to looked position?

I'm trying to get an object to smoothly rotate towards a clicked point in my terrain. However, my code only yields jittery movements in the other direction. Any help will be greatly appreciated. ...
0
votes
1answer
39 views

move sprite relative to position on another sprite (sword and player)

I'm sure this is a common problem people face but I can't find much on this topic after some googling. I have a sword, and a player, both which are sprites. I want the sword to be attached to the ...
0
votes
0answers
42 views

I have a script that changes an object to a broken version of itself when clicked, but it keeps rotating the object

So I have made a script in unity that you put on an object and when you click the object it will delete the object and replace it with a broken one I made in blender. My problem is that when I click ...
1
vote
0answers
41 views

Create an atlas texture in photoshop to use in unity

To create a button in NGUI looks like we need to create something called Atlas that is a material that contains a lot of little images called Sprites. I created a set of 40 sprites (for 20 buttons ...
0
votes
0answers
29 views

Mesh tilemap and scrolling

I'm working on a top-down game where the player can move up, down, left, or right. I've come across tilemaps but since using Unity, I'm seeing the idea of using Meshes. I don't quite understand how ...
1
vote
1answer
57 views

How can I mask this CanvasRenderer?

I'm creating a text box that allows for selectable text, based off of Unity's InputField. An issue I am now facing is that the selection highlight does not respond to masks (The parent has a mask, but ...
0
votes
2answers
43 views

Stencil based mask with alpha

I'm trying to create a fog effect like civ 5: I tried creating a StencilSet shader that receives a mask and sets the stencil buffer to 1. I would render the following on every unexplored tile using ...
0
votes
1answer
24 views

Getting curved-based zooming speed?

I am able to get a fairly smooth zooming function going on in my project. However I'm hoping to achieve a non-linear function. I've tried using the smoothstep function but it doesn't feel smooth ...
0
votes
0answers
31 views

Question about designing and controlling a forklift's forks

I am building a forklift for a game that I am working and I am trying to come up with a valid way of designing it. So far I haven't really liked the way it behaves in game The forklift has three parts ...
1
vote
1answer
26 views

Update total enemy counter after single enemy is defeated?

So I have a list that counts how many enemies are in the area. But when I kill an enemy, the list shows that that element in that array is missing, and doesn't reduce the enemy counter. How can I get ...
2
votes
1answer
77 views

How do I make an AI that stays at a distance from the player act correctly when cornered?

I am working on a few different AIs for a tile-based game. I'm trying to figure out one where that tries to keep a certain distance from the player. So if distance becomes small, move away. The whole ...
0
votes
4answers
59 views

How to add tiles randomly?

I made a set of 10 different "ocean" tiles, all interchangeable with one another, and I'd like to randomly attach these 10 different tiles together in different combinations over a large rectangular ...
0
votes
1answer
42 views

Enemy AI with Rigidbody - Floating in the air

I'm working on my enemy AI scripts and I'm using a rigidbody to have the enemies chase the player when the player gets into its aggro distance. Two of the main problems I'm having: When the game ...
0
votes
2answers
66 views

How do I trigger OnSelect() via the ISelectHandler in my class?

I'm trying to figure out how I can make a custom UI element identify when it has been selected or deselected. Classes such as Selectable inherit from the ISelectHandler and IDeselectHandler and their ...
0
votes
1answer
67 views

[Unity]Making sure playermodel only moves 1 unit

I am doing a school assignment based off of the Unity3D tutorial 2D RogueLike (all code available here) In my version though, the movement is not turnbased and I am having some trouble figuring it ...
1
vote
1answer
53 views

unity3d model falling apart

I found something I can't understand. I'm only a beginner, so I thought I could use the CarController Scripts of the Car Demo for making a little driving game with different models. I wonder why the ...
-4
votes
0answers
26 views

How can I add a force to a gameObject when I touch UI button in unity 5 [duplicate]

I'm using unity 5 How can I add a force to a gameObject when I touch UI button I want the ball to jump when I press that UI button
1
vote
0answers
16 views

How do I get line numbers in a unity headless server's stack trace?

For some reason Unity 5 doesn't allow me to do a developement build of a headless server, and this is quite a problem when debugging, since I get stack traces without line numbers, such as: ...
0
votes
1answer
32 views

Material not changing Unity3d [duplicate]

I have a MeshRenderer mr public variable in script1. I dragged mesh1 from the assets in the mr place in the inspector of script1. mesh1 has a material mat1, I try to change this material to mat2 using ...
0
votes
0answers
12 views

Texture colour not matching sprite?

As per title, I am unable to get my texture to match the colour of the background sprite. How would i go about alleviating this?
2
votes
1answer
35 views

Is it dramatically more efficient to have less BoxCollider2D's (for raycasting/custom physics)?

I have a temporary tile system for my platformer where I simply duplicate the same tiny box sprite with a BoxCollider2Don it over and over again. Like I said this is a temporary procedure for design ...
0
votes
1answer
25 views

Error compiling Unity after porting to mac

I used BitBucket to move my project from a PC to a Mac, now I can't compile in my Mac, as I get the following error: Error building Player: Win32Exception: ...
0
votes
1answer
41 views

Unity: Restrict movement inside a gameobject (2D)

I've been sort of trying my own thing but it's super buggy so I'd like to see what other people have done to create moveable spaces. In essence, I just want to restrict my character's movement to ...
0
votes
2answers
39 views

Can we create same name class for different objects in unity?

I have four similar objects in my game. As they are all similar therefore I have created a single script that defines mash for all of them. The script that defines mash for these objects uses a ...
0
votes
1answer
43 views

Getting position of finger along a screen

I'm trying to get a list of Vector2 position by tracking my finger and then tracing them with a prefab (Basically just gestures). I have appended an onGUI function to help print out the list of ...
0
votes
1answer
68 views

Display and render only a specific object in wireframe in Unity3D

I want to know how to view and render a specific game object (mesh) in wireframe, not the whole scene. I can change the scene to wireframe using GL.wireframe but the problem I want to view and render ...
2
votes
1answer
77 views

What can cause shadow slicing while moving camera?

Can't explain better than with video: https://youtu.be/4nIMIL6w-0M The effect I'm trying to achive is a simple fog of war. See, I have a point light casting shadows on a plane. The plane has a ...