Unity is a highly cross-platform engine that focuses on easy art pipeline process and uses Mono as its scripting back end.

learn more… | top users | synonyms (1)

1
vote
1answer
48 views

How can I make an attached gameobject behave correctly on character flip?

I have a character that on start-up is equipped with another gameobject/prefab as a weapon, attaching it to a hand. void Start() { handFront = transform.Find ...
0
votes
1answer
46 views

How to Integrate Unity with Google Play Game Services for iPhone and Android games

I want to integrate Google Play Game Services for Apple's iOS and for Android. How can I do this efficiently?
-1
votes
0answers
27 views

Shake Device on Orientation Change

I am developing 2d game with landscape and portrait orientation support. I write following code for this purpose. public class DeviceOrientationController : MonoBehaviour { private bool isLandscape; ...
7
votes
1answer
179 views

Finding the correct speed for AI to turn to reach goal

I have a ship that travels at max speed maxSpeed and can turn rotationSpeed degrees per second. The ship always moves in the direction it is facing which means that the faster the ship is travelling ...
0
votes
2answers
82 views

How can I make RPC function calls in Unity?

I am making a multiplayer game. I am sending score via the server and client but I want to be sure that can I call an RPC function of a script from any other script. For example, say Table_Manager as ...
1
vote
1answer
47 views

How to put basic scripting/variable changes into dialog xml files?

I have a simple XML structure for my dialog between the player and NPCs. What I'd like to do is put variable changes (and maybe other things) directly into the XML. So, for instance, if you select a ...
0
votes
0answers
51 views

Script to intelligently move aircraft using curves [Unity]

I am trying to code a script to move an aircraft entity from point A to point B and at some point in the middle of moving have the aircraft forward vector face Point C (to fire a missile at an enemy ...
0
votes
2answers
186 views

How do I randomly spawn objects in 2D game?

How do I randomly spawn few different sprites on screen so they're not overlapping or half visible on render. The sprites should immediately start shrinking until they disappear. I've tried to ...
-1
votes
0answers
21 views

access camera animation on unity from scripting

i have made a simple animation for moving the game camera from one site to another, for the purposes of showing a menu, and then, going to the zone of the game itself. I do this using the animation ...
2
votes
2answers
140 views

Shader that “cuts” hole through all geometry

How can I create a shader that "cuts" through all geometry, only rendering the clearing background in Unity? An example: That's a prism in a huge white box-shaped room. The surface of the prism is ...
0
votes
1answer
43 views

Playing an animation relative to current Transform in unity?

I have an animation created with the built-in dope sheet. It plays correctly but I would like it to be played relative to current object transformation. For example I have a palm tree that moves its ...
2
votes
1answer
50 views

Adding an object viewer to a Unity Editor Window

I'm wondering if its possible to add an object viewer (For example when you import an .fbx file into unity you can see a small preview of it in the inspector) to a Unity Editor Window? I've looked ...
1
vote
1answer
160 views

How does the Unity3D entity system work?

I saw the Java Artemis Entity Component System and thought of the entity system in Unity3D. In Artemis for example you can only add one component type to each entity and the logic is not in the ...
1
vote
1answer
47 views

In Unity, how can I read the color from _LightColor0 in a shader?

I have a scene with a point light and alpha textured (RGBA) triangle strips. I want to apply the point light color with a shader. Shader "Custom/Test02" { Properties { _MainTex("Texture ...
0
votes
1answer
45 views

Increase animation speed according to the swipe speed in unity for Android

I have the animation done through Maya and brought the FBX file to unity. Here is my code to calculate the speed of the swipe: Vector2 speedMeasuredInScreenWidthsPerSecond ...
1
vote
2answers
67 views

How to know when all 2d rigid bodies have stopped in unity3d?

Is there anyway to know if all 2d rigid bodies in untiy 3d phisics world have stopped?
1
vote
1answer
408 views

InvalidOperationException when using C# DLLs with Unity3D

Description I've been attempting to use a custom DLL in Unity. I've confirmed the DLL runs correctly outside Unity. The DLL imports into Unity and when I refer to it in my scripts, I get no compiler ...
0
votes
0answers
55 views

Unity 2D - SpotLight and Shadow

I've been having some trouble in the process of creating my 2D game. Here is the thing, i want to create a light source on the top of the screen, blocked by some rocks and letting only go through some ...
0
votes
1answer
102 views

Change the sprite of a Object in Unity

Inside the script code of the the hero(object) I want add the possibility to change its sprite. So the player hits the space button and the sprite changes into the other sprite already added to the ...
0
votes
1answer
38 views

What is the actual formula to find the vertices of an animation frame in using a BVH file?

I've read this tutorial and tried many formulas to build the skeleton. I am able to build it without the rotations, but those break everything. This, for example, is a simplified code for one of my ...
-1
votes
0answers
79 views

How does sketchup do it? Previews that is

Well i've been working with HUGE models that I got from sketchup warehouse which I need to shrink some how because they are amazingly big. Decimation would work if they weren't textured. (meshlab wont ...
0
votes
1answer
35 views

How I get the value from different class [closed]

i get error , i cant get the value from different class.. public class First1 : MonoBehaviour { private List<IFirstListener> listeners = new List<IFirstListener>(); public int ...
0
votes
1answer
139 views

Basic hierarchical component access in Unity: GetComponent vs. Find

I'm just learning to develop in Unity. One simple thing I'd like to do is change the colors of objects programmatically. I have a compound asteroid prefab object, in which the meshrenderer and ...
2
votes
1answer
57 views

Can animation parameters only be changed in scripts?

I have a very simple animation parameter in the Animator, a boolean that is "true" when a shooting animation is playing (to stop the game logic from allowing more shooting during a gun recoil ...
0
votes
1answer
90 views

How to find objects in front of my player

I am trying to find an object that is in front of my player sprite using the following code RaycastHit2D hit = Physics2D.Raycast(transform.position,Vector2.right,EnemyLayer); //EnemyLayer is the ...
1
vote
0answers
85 views

How do I load real-world map terrain? [duplicate]

I'm new to game development and want know how to make or load a terrain from OpenStreetMap or Google Maps in your current city. (I'm using Unity3D.) My idea is just load or generate a map of the ...
0
votes
1answer
113 views

How can I get multiple sprites on a Unity2D Sprite Renderer

I have a GameObject that I want to have multiple sprites. I tried adding an extra Sprite Renderer, but it tells me I can't add the same component multiple times. I'd really rather not have to have ...
1
vote
1answer
51 views

Unity objects not rotating around pivot point

Suddenly, for some reason, objects in the unity editor started rotating around their center of gravity (at least that's what I think is going on) instead of their pivot point. I tried placing the ...
1
vote
1answer
86 views

How to translate swipe gestures into rotations?

I am making a snake game. I want to rotate my snake in the direction specified by swiping on the screen, the directions are limited to orthogonals (90 degree increments). It's an android game. Can ...
1
vote
1answer
98 views

How can I translate a game object towards a position?

I am instantiating my game objects (spheres) through scripts. I want my spheres to move from one location to another. but I don't know how to do this. Update is called once per frame. Is that what I ...
0
votes
0answers
39 views

Moving object next to another object

Is there a common way to get to game objects with colliders to 'touch' each other without trying to reach the same position? I dont want to move object A to the position of object B cause they will ...
2
votes
1answer
40 views

Unity3D How to tell when editor script is added to object

What I want is a way that an editor script can tell when it has been attached to an object in the scene. OnEnable() and Awake() only happen when you bring an object with the editor script attached ...
1
vote
1answer
94 views

Creating teams 2v2, 3v3, etc

I'm figuring out how to create games with teams. The problem is that there will be games 1v1, 2v2, and so on as well as free for all. What would be the most efficient way to do this in Unity C#? I'm ...
0
votes
1answer
63 views

How do I add a Rigid body and a box collider component to a Texture2D?

I am making a snake game. I'm basing it on a basic tutorial game, which does no collision detection, wall checking or different levels. All snake head, piece, food, even the background is made of ...
0
votes
1answer
41 views

Stopping sprties from toppling off platform

I am new to Unity and am trying to create a simple 2d platformer. I have applied a box collider to my player sprite and the floor/platform its standing on. Now when I go over the platform, it toppes ...
0
votes
2answers
186 views

Unity 2d: How stop movement when object hit a wall

I created a square that slides on a flat ground. public class PlayerMoveScript : MonoBehaviour { float move = 0; void Start (){} void FixedUpdate () { if (move == 0) { ...
2
votes
1answer
112 views

C# - Separating Overlapping Rectangles

I'm trying to separate an arbitrary number of randomly sized rectangles, while still keeping them snapped to the grid, and somewhat packed together nicely. The goal is to start with something like ...
0
votes
1answer
32 views

unity rts on mobile : how can units find each other as simple as possible

Situation: I have a grid of 100 by 100 tiles. each tile has a list of units that are currently standing ontop of it. in this grid 500 units of team 1 and 500 units of team 2 are randomly walking ...
0
votes
1answer
79 views

How do I make an object's y-axis align with a Vector3?

I have a golf ball on the ground, and from a raycast, I have the normal which gives me the slope of the ground by the ball. I have an object which is rendered on the HUD to show that slope to the ...
1
vote
2answers
104 views

Compute world position by walking N units along spline?

My goal is to move ahead along a spline 'x' world units, unfortunately there is no way to map spline points to world points. What I do is I iterate along the spline by a small alpha amount (say ...
3
votes
2answers
124 views

What are Unity3D Substances?

Recently in a tutorial I saw the use of substances in Unity3D. What I got from the tutorial is that a Substance is a material, which we can manipulate dynamically on run time. I am still unclear about ...
1
vote
1answer
101 views

Unity3D Multiplayer Networking

I am making a multiplayer game using Unity3D, similar to SecondLife (but focusing on a particular gameplay task). Users will be able to register/login directly in the game and their character will be ...
0
votes
2answers
264 views

Unity - 2D Wall Jumping [closed]

I'm developping a 2D platformer and i'm facing a little trouble. I'm actually trying to develop a Wall detection and the possibility to Wall Jump and go in the opposite direction. I'm able to detect ...
2
votes
4answers
171 views

(unity) move the world or the character

I'm making a game like this: https://www.youtube.com/watch?v=hO7573lphqI wherein a 3D ship is flying around on a 2D plane. From the player's perspective, the ship will stay stationary in the center ...
0
votes
1answer
100 views

Why is mesh baking causing huge performance spikes?

A couple of seconds into the gameplay on my Android device, I see huge performance spikes caused by "Mesh.Bake Scaled Mesh PhysX CollisionData" In my game, a whole level is a parent object containing ...
0
votes
1answer
87 views

How can I switch two GameObects in an array in Unity?

I'm putting together a match-3 as my first unity project and I'm having some trouble with switching two GameObjects. I thought I had it working, but I was running into strange issues. I hunted them ...
0
votes
0answers
103 views

Cross-platform ad-hoc local mobile multiplayer

I want to implement ad-hoc cross-platform (iOS, Android, and PC) device discovery for local multiplayer, like this scenario: http://www.youtube.com/watch?v=csXYZf2vGdE Multiple players, each with ...
0
votes
1answer
115 views

Unity3D animation trigger reset

How can I reset conditions for animations using an animation controller? I have a door that will open when a boolean property in a script is set to true. This then calls setTrigger on the animator to ...
0
votes
1answer
76 views

Unity animations in iOS

I'm an iOS developer and I'm trying to make 2d animations with Unity 4.3 + RageTools Pro + RageSpline. I want to integrate the animations into a native iOS application. In Unity I have different kind ...
0
votes
0answers
60 views

Selling Game Apps Online Condition: Export Law

Is it legal to publish and sell Android game apps powered by Unity 3D, regardless if it is a paid app or free app? I found on this terms and conditions or agreements, no. 11 on export law. Is there ...