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)

0
votes
2answers
548 views

How to reverse gravity in Unity

I'm trying to figure out how script gravity reversal on collision with an object. How can I reverse gravity?
0
votes
1answer
124 views

Casting a directional line of which an object is coming from

I want to create a directional line ( curve / linear ) depending where the direction is coming from. In some games, similar to Angry Birds, a dotted guideline is shown to provide where the gameObject ...
4
votes
1answer
385 views

How is a Game Manager supposed to be constructed?

I'm a beginner developing games on Unity3D and now that I've become a little bit familiar with GameManagers I've been wondering about certain aspects. How do you contruct a GameManager in the most ...
2
votes
1answer
270 views

How to put the game object to the upper left corner of the screen in Unity and make it visible entirely on all screens of mobile devices

I have game object which displays health indicator in my 2d video game in Unity. This gameobject contains a lot of sprites and i put it into left/top corner of the screen. In my game editor it is ...
1
vote
1answer
131 views

How can I resize my Blender models when importing to Unity?

I made a 3D model in Blender, but when put it in my Unity project and add an FPS-camera the camera is bigger then my model. I used the measurements of Blender (that one cube is 1 meter in Unity). How ...
0
votes
0answers
286 views

Unity3D C#: How to resize an inputfield according the content which is set dynamic

I've got an InputField where the text is filled in upon getting a string back from the server. We can debug the entire text so we receive it correctly. However the text is too long to fit in our ...
0
votes
2answers
156 views

Unity3D : Unity fails to detect null objects

im instantiating an object which is gonna play the background music for my game. On the Awake() function I check if there is a gameobject with the tag "MusicPlayer" on it, and if there isn't any I ...
0
votes
2answers
540 views

How can I move objects pixel by pixel in the scene editor?

I'm trying to find a way to move objects pixel-by-pixel(on my screen at least) in the scene editor. I tried a lot of different buttons but nothing seems to work, please tell me Unity has this ...
-2
votes
1answer
101 views

Joystick control for camera only works when button pressed

I'm trying to use a controller that has a joystick. I'd like to move the camera when the player moves the joystick. The joystick also has a button. So far I'm only seeing the camera move when the ...
0
votes
0answers
33 views

Creating a ray with angle movement restrictions

In Unity is it possible to create a ray which has movement restrictions. As in creating a ray which is fixed to one point. When this point is moved around. The line is also moved around. But when the ...
2
votes
3answers
529 views

Unity Raycast shoots right through some objects

I made a melee combat system for my game. The code looks like this: var hit:RaycastHit; if(Physics.Raycast(transform.position,transform.forward,hit)) { if(hit.distance<=2.0) { ...
0
votes
1answer
180 views

(Unity)How to make the BGM not stop between scenes

I want my BGM to keep playing on loop, but whenever I transition into another scene, the loop starts over. Is there any way to have the scene record the last point of the music it plays, and in the ...
0
votes
1answer
35 views

Destroy a single list member

im trying to destroy a single game object using the following script but it destroys all of them , not the ones I want. I want to destroy the ones that the transform that holds this script collides ...
0
votes
1answer
213 views

Finding a moving target in a maze

I'm making a game that is a bit of a mix of snake and pacman. Basically, two players go through the maze and each time they pick up a piece of candy, a cube is added to their tail. If one player ...
0
votes
2answers
535 views

How does Vector3.Angle compute the resulting angle?

I don't understand the concept of Vector3.Angle in Unity. Can someone please explain in detail how it computes the angle? From which two points is the angle measured? It would also be really awesome ...
0
votes
1answer
372 views

Jump Issue(Unity3D)

This is my first character control script. Where a cube is my player and the objective the i want to achieve with my script are 1.the cube moves in horizontal axis till the button is pressed once ...
1
vote
0answers
57 views

How can I keep vertex order the same on every Instantiate()?

While trying to resolve another question, I have discovered that if I Instantiate() from a prefab, the order of the mesh vertices (and therefore triangles) is inconsistent between instances. This is ...
0
votes
1answer
613 views

Find index of GameObject in array of GameObjects [closed]

In my script, i have declared an array of GameObjects like this: public GameObject[] go;ld object name. `String temp;` Also, i have a temporary variable to ho Then, i assigned objects to elements ...
4
votes
1answer
383 views

How can I separate component functionality from networking logic?

Is it possible to make network independent components that allow networking details to be specified externally? For example, if I have a "Follow" script that follows a game object, it would need to ...
1
vote
1answer
133 views

How to transform Unity terrain coordinates

My map creator created some terrain in Unity, but all my scripts are based on the X-Y axis. Is there an easy and smart way to transform them into Z-Y, or do I have to change all the vector variables ...
0
votes
2answers
2k views

How can I make animations “snap” between transitions in Unity?

I have an animator with a few animations in it. These are very basic animations, just changing a transform to slide a sprite around in a cutscene. The issue that I'm running into is that when I ...
2
votes
1answer
723 views

How do I change a Unity 4.6 Sprite's textureRect at runtime?

I'm using Unity 4.6, and I've made a sprite like this: AtlasFrameData frame = _testAtlas.GetFrameByIndex(0); Rect spriteRect = new Rect(frame.Position.x, frame.Position.y, frame.FrameSize.x, ...
3
votes
1answer
387 views

Change unity physics engine speed

Is there a simple way to change the speed* of unity's physics engine like in the game SuperHot? Any script language is ok but javascript is preferred. *I am not sure if speed is the correct term.
1
vote
1answer
275 views

Environment collision in a pseudo-3d 2d space

The game is a 2D brawler with depth movement in the vein of Golden Axe, Final Fight, Castle Crashers etc. Characters and environment are all 2d sprites as well. I've had no real issue setting up ...
0
votes
1answer
106 views

Unable to instantiate objects Straight in unity

I am creating a match card game in unity and I want to place cards in straight direction that is one below another and so on... But with my formula It's showing cards one after another.Please tell me ...
5
votes
2answers
219 views

How can I consistently identify location on a mesh from a raycast hit?

I am using RaycastHit.triangleIndex to identify a location on a mesh (very low poly). However, I have discovered that a given triangle on the mesh does not have the same triangleIndex value from one ...
0
votes
0answers
61 views

Unity StartApp Ad Sdk dims the screen down when showed

I'm making an android game Which Never Sleeps and it don't. But When Using Startapp ad sdk It seems that it pauses the game and the mobile sleeps when the ad is shown. As if the sdk handles it from ...
1
vote
1answer
247 views

Trouble With Quaternions and orbital camera:

UPDATED: I have been trying to implement a Orbital Camera of sorts in a engine I am currently doing in Unity3D, the issue being I can't seem to do the correct rotation no matter what. This is what it ...
2
votes
1answer
93 views

When two RPC methods have the same name, which is called?

I have a situation where I would want two of the same components( in a hierarchy ), to be on a GameObject. If this component has an RPC method, it obviously cannot change name per instance of the ...
0
votes
0answers
74 views

Stream Unity video and audio straight to a webcam

I want to render my unity game straight to a web cam feed. I'd like it to show up as a webcam so I can use it as an input source when I'm video chatting. I've looked into DirectShow and I think I can ...
0
votes
2answers
269 views

How can I disable an NGUI button when I pause my game?

There is an NGUI button in my game, which when pressed increases the player's power. When I press the escape key, my game pauses completely. But the button still functions normally. Here's how I ...
-2
votes
1answer
113 views

Split up a string and add each as an item in an array [closed]

I have an input string and input the following "2, 4, 5, 7, 10" (for example). How can I split it as an object(item) for a list array? so it would be in each item "2", "4", "5", "7", "10"
3
votes
2answers
148 views

Mock Collision Object in Unity

Problem: I'm trying to set up some tests with mock collision objects, but i cannot construct collisions with custom objects. What I'm trying to do: Collision2D col = new Collision2D(); ...
2
votes
2answers
197 views

Unity messes up the fileIDs

I'm working in a team of three people on a 2D game, and Unity recently has been messing up the fileID on many sprites: - m_Sprite: {fileID: 21300000, guid: 6186fa4d068aae8418d9520f658d1ee6, type: 3} ...
0
votes
1answer
112 views

Where should I put code if I want it to run automatically?

I'm new to programming and I found an animation script that has code that is called in the OnMouseDown event, when the user clicks the object. I'd like the code to run automatically, instead of ...
0
votes
0answers
44 views

Bones are incorrectly rotated in FBX after Unity import

I am importing an FBX into Unity. The problem I have is that it looks like the bones are rotated by 180 degrees. When I try to rotate the them the whole model is also rotating. How can I fix this? ...
1
vote
1answer
194 views

How to constrain axis-angle rotation?

I have a problem where I'm performing an axis-angle rotation and am trying to constrain my rotations. Specifically I have a skeleton (model/mesh with rig, transforms are hierarchy parented to pelvis ...
0
votes
1answer
551 views

How to execute code every x seconds in unity?

So I have a flashlight battery script I created and I need to know how do you make the battery variable go down every few seconds(whatever time you set.) I tried InvokeRepeating but it was an absolute ...
0
votes
0answers
56 views

How do I view currently downloading assets in Unity?

So I'm completely new to Unity, and in order to do some tutorials on their website I need project assets from their Asset Store. So, I go and download one, and I had no idea to see it was downloading ...
2
votes
0answers
586 views

Getting child collider when collision occurs in compound object in unity3d?

I have a compound object. The parent of the compound object hierarchy has a script that is listening to the OnTrigerXXX callbacks of the children. When this compound object collides with other objects ...
0
votes
1answer
174 views

Assigning multiple game objects to a single sprite (Unity)

I've been making a pokemon game clone on my own with Unity, as I'm a beginner and just trying to learn. Up until now I've been splicing the town pictures and manually putting them together, but this ...
3
votes
3answers
390 views

How to create a two-way teleport system?

I'm trying to create a two-way teleport system in which players can move into a teleport gameobject, and is then teleported to another linked teleport gameobject. How I was planning to have it work ...
0
votes
1answer
144 views

Why does Unity save textures in bitmap format for APKs and IPAs?

Why does Unity save graphic resources in Android apks and iOS ipas in a bitmap format(width*height*bpp)? I want to save my resources in a small apk, but instead of 1mb for an image Unity stores 11mb ...
13
votes
1answer
939 views

How do I render my 3D game in ASCII art?

I'm trying to create an Easter egg for a 3D game in Unity3D. I want to render my game momentarily in ASCII art. My first idea is to create a shader to do that, but I'm not sure if it's the right way. ...
0
votes
0answers
955 views

Rotate object against Gyroscope in Unity

I would like to rotate a simple object against the z-rotation of the gyroscope of a smartphone, so that the object will always "look" to the physical floor where the user is standing. After that, I ...
0
votes
0answers
223 views

Change graphics in-game (without needing to restart)Unity

Hey I am new to scripting and I am not so sure if this is possible to do in Unity. Currently I have it for example; public void AntiAliasing(GameObject Description){ sliderValue = ...
3
votes
1answer
150 views

How to create laser redirection?

Think portal 2, where a laser can go through a cube, and depending on the rotation of that cube, it will redirect it. Examples: Here is my barely functioning code. It works for one cube, I'm able ...
0
votes
2answers
356 views

Can the GUI be used to create game objects?

I want to be able to position 10 various game objects (sprites) within the area of the screen which will be dynamically sized accordingly to the screen size of the device. The area in which I want to ...
3
votes
1answer
363 views

Parallax effect for layers in Unity2D

I have a simple game scene where i have put a number of images. I combined these images into layers (SortinLayer, to be specific). So now I have 3 layers. I have read a few tutorials, but in them was ...
1
vote
0answers
55 views

Manual response when 2 shapes made of rectangular volumes collide

I have 2 compound objects made of rectangular blocks. One of them (the one that is moving) has a script that listens to OnTrigger callbacks. What I need is to position the moving compound object on ...