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)

0
votes
1answer
247 views

Can I use clipping with Unity Sprite in NGUI?

I used NGUI free version (2.7) with Unity 4.3. I have tried to use clipping to restrict the area of viewer by using clipping to hide some content of Unity Sprite. However, it did not work. If it's ...
3
votes
3answers
109 views

How to launch a prefab at the mouse position

I want to use Instantiate(item, new Vector3(...), Quaternion.identity) to land an item at the position that was clicked. My game is using a third-person view (example). This is the code that I think ...
6
votes
3answers
708 views

Create a trailing, ghosting effect of a sprite

I want to create a trailing, ghosting like effect of a sprite that's moving fast. Something very similar to this image of Sonic (apologies of bad quality, it's the only example I could find of the ...
1
vote
1answer
162 views

Displaying streaming video on dynamic texture

We are working in Unity 3D on pro licence and we are faced with the task to display streaming video as a dynamic texture in out Unity3D web project. We have a standard IP-camera , which is capable of ...
0
votes
1answer
65 views

Unity-Animation parameters are not being set

I have the following animation controller: with two parameters of walkingSpeed and Jump. I have the following code which should change the values: animator.SetFloat("walkingSpeed",0.9f); ...
1
vote
1answer
190 views

Adding an existing script to a gameobject programmatically

Is there a way to take a script and apply that specific script to an object through code? In pseudocode, what I'm trying to do is essentially as follows: ObjectOne.MyScript = ...
4
votes
3answers
231 views

Why does Unity in 2d mode employ scaling and the default othographic size the way it does?

I previously used SFML, XNA, Monogame, etc to create 2d games, where if I display a 100px sprite on the screen, it will take up 100px. If I use 128px tiles to create a background, the first tile will ...
-1
votes
4answers
179 views

How to increase the game “level” after certain amount of objects spawned?

The game is supposed to increase the level by 1 every 10 spawns of an object, using totalShots % 10 == 0. So, when totalShots is equal to 10, 20, 30, etc. the level should increase by 1, however, the ...
0
votes
1answer
167 views

How to randomly spawn object using instantiate

I'm trying to spawn objects which move in one direction until they hit a player or the barrier. The spawner is a cube which moves between two points to spawn the object at different locations. The ...
0
votes
1answer
210 views

Going from WPF to Unity3D, how to implement the MVVM-pattern?

I've been working with MVVM in WPF for a long time and I'm now trying out Unity3D for a GUI-driven application. Can I work with view models and bind them to properties in GUI-components? I guess the ...
1
vote
2answers
126 views

Object goes straight through game object without colliding

The "shot" is supposed to collide with the left bumper and then be destroyed, but the shot goes right through it. Both objects have a box collider. The following is the code I am using: #pragma ...
0
votes
1answer
58 views

Can I have a fixed-angle sprite with a non-fixed-angle CircleCollider2D?

In Unity2D, can I have a fixed-angle sprite with a non-fixed-angle CircleCollider2D? I would like to move my character using the circle physics (without fixed-angle), but display him always as if he ...
0
votes
1answer
219 views

How do I efficiently display image tiles in Unity 4.3 free

I previously wrote a TileEngine with SFML that I would like to port to Unity3D 4.3, but have not found a way to draw a tile on the screen programmatically in Unity. All I am looking for something ...
0
votes
0answers
62 views

Swiping with rigidbody

My character moves continuously forward with rigidbody.velocity = v3Force * strength; My Swipe script is based on a youtube tutorial from https://www.youtube.com/watch?v=9ZIHx09GevI I just changed ...
1
vote
3answers
155 views

How to manage variables and/or data?

Let's say I have a class A with many constants (over 20) and variables (also around 20). Class B represents a character so it has a lot of constants and variables representing various stats. Class C ...
2
votes
1answer
142 views

How can I create or extrude a mesh along a spline?

Let's say, for example, that I have a working spline. I want to use this spline to create a mesh, but I'm not quite sure how to go about it. For example, I want to create a road along this spline. I ...
0
votes
1answer
122 views

Background Sprite Setting

For my 2d game, I want to set background image. So that I am using multiple background images for that purpose. But it can't set correctly on screen that illustrated in following image. Also for ...
0
votes
2answers
155 views

Stormy water like Temple Run 2 for Mobile

How can I make stormy water like they did in Temple Run 2. I've tried with Unity Water Pro to achieve the same result but when I include it in the project the frame rate crashes to 3 frames per ...
0
votes
0answers
82 views

How to implement 2D Ai Wandering with 8 - directional movement using Perspective Images in unity 4.3?

My requirement is to move a 2D characters with perspective view images has to wander in game area by choosing dynamic path and according to that the AI character has to switch the animations based on ...
0
votes
1answer
91 views

Free Look Camera Like Arma 2 while pressing ALT [closed]

I'm trying to create a simple script that give me the possibility to rotate the camera while pressing a key. So, in a pseudo-code way, how I can intercept the Input event and limit the player's ...
0
votes
1answer
73 views

'Dynamic' textures?

I am creating a 3D game in Unity. The main game mechanic involves a large open world area. In various places throughout this world are billboards and other devices that would show 'adverts' etc in the ...
2
votes
0answers
66 views

Unity3D — WAV plays an octave too low on Android

I have generated a synthetic 'concert pitch A' tone from sinewaves. It plays properly on OS X player, and on my Android device. Now I record myself singing a 'concert pitch A' into the microphone as ...
0
votes
0answers
79 views

Realistic collisions with a kinematic rigidbody?

I have a car game where player drives a car; this car has a collider and a kinematic rigidbody attached and is completely controller by script (i.e. a script sets its position and rotation). In the ...
2
votes
1answer
163 views

How can I manually draw a Sprite in Unity?

I'm creating a simple workaround on the unsupported prefab-on-prefab. I've thus created this simple class: [ExecuteInEditMode] public class PrefabLinker : MonoBehaviour { public GameObject ...
1
vote
2answers
92 views

Unity - Across the wall

I have a problem here. I animated my main character and is working. It walks run and jump however it goes across walls and ground. As in every single video I watch in unity tutorials I put a ...
6
votes
1answer
225 views

How do I make a slot car game?

I new to game development with Unity and my first project is a slot car racer. For a realistic slot car-like-driving experience, I first build a track with a channel in the track and a pin on the car. ...
1
vote
1answer
332 views

Unity Move sprite from point A to point B

Pretty new to Unity and i'm trying to make a very simple iphone game. , I'd like to know how to move a sprite (2D) move from random point A to random Point B not just that, but i want it to change ...
1
vote
1answer
68 views

Different OnMouseDown functions based on where an object is clicked

So my problem is I'd like to have one GameObject with multiple "OnMouseDown" functions. I have a target (classic looking bullseye) and I'd like to award a player say 10 points if they click on it, but ...
1
vote
2answers
106 views

Android Activity access Unity Classes

I have made my own C# classes in Unity, is there any way I can access these classes from the Android Activity that starts the UnityPlayer? Example: I have a C# class called testClass in Unity: class ...
3
votes
4answers
96 views

How can I avoid updating my Unity projects when I have two versions installed?

I currently have two versions of Unity on my Windows computer. I would like to not update my projects to avoid compatibility issues like I had in the past. Installation in another folder goes just ...
5
votes
4answers
465 views

Does Unity let you code in Java?

I am fairly new to Unity3D experience , but I have a very good knowledge of Java and Android development. I am really confused that if Java is at all needed for developing android applications? I read ...
2
votes
2answers
94 views

Do I have to use new keyword for unity single game object?

I'm using Unity4. Do I have to use new keyword for single game object? look at the following code. 1. GameObject obj = new GameObject(); obj = Resources.Load("Prefabs/Ball", typeof(GameObject)) as ...
2
votes
3answers
1k views

How to reset the world in an infinite runner game to prevent an overflowing float?

Im following Mike Geig's 2D infinite runner tutorial. However, I'm seeing a potential problem of overflowing the float How can I reset all objects and camera back again to the origin? The approach ...
1
vote
0answers
148 views

Photon unity networking PhotonNetwork.Instantiate issue

I am using Photon Unity networking. I am using the PhotonNetwork.Instantiate function to spawn players on local and remote devices (iOS and android). Newly connecting players automaticaly spawn at ...
1
vote
1answer
146 views

Unity 2D camera drifts from player as speed increases

I have a dilemma that I did not have in XNA before porting my game to Unity. First-- my goal is to mimic Super Mario World 2's camera tracking in x. The camera tracks to 1 block ahead of the player, ...
1
vote
2answers
114 views

Hide part of the GUITexture in Unity

I have a Health Bar in my Unity game and it's implemented as a GUITexture with gradient image from red to green. Now I can reduce it's width from max width to 0, but is still scaled gradient. ...
3
votes
2answers
156 views

Using this.GameObject

I once read (I actually don't remember where, I'm looking for it) that using this.GameObject to call the script owner is a very bad practice. I believe it has to do with some sort of information ...
3
votes
2answers
600 views

Unity - Part of the sprite is covered in shadow

I have a sprite with Transparent/Cutout/Diffuse shader. Recieving shadows is turned on in SpriteRenderer. The light is a pointlight and I am using deffered rendering path. However when I am above or ...
1
vote
0answers
83 views

Unity crashes completely when I rotate my objects

I've started my first tiny Unity project and after 20 minutes I run into a brick wall. My goal was to create a Android 2D game with falling polygons, that you have to click and they disappear. ...
4
votes
1answer
99 views

Why are cube map axes sometimes labelled incorrectly?

In both 3ds Max (which uses a right-handed coordinate system) and Unity (which uses a left-handed coordinate system), the cube map faces labelled "left" and "right" show the view facing the opposite ...
1
vote
1answer
134 views

Scaling HUD and Camera

I wanted to display an HUD, similar to the strategic games' one (like in DotA 2, Warcraft III, Starcraft II or Age of Empires). I didn't really know how to do it, so I managed to create a Texture ...
2
votes
1answer
78 views

Unity - Quaternion - Rotate / Unrotate Error

I'm trying to unrotate a quaternion, aligning it with the axis, and then rotate it back to where it was originally. But with every iteration it seems to lose precision and just after 20 iterations the ...
0
votes
0answers
24 views

Separate shape in to a new object in Wings3D

I am working on a 3d model and I am having the following question: If you have one solid object and you have a specific part that you want to separate into a new object so you can move it and Unity3D ...
0
votes
0answers
117 views

Android Proguard with Unity3d return error code 1

I am using the proguard 4.11 with the Unity 3d In my project , I have include the unity-classes.jar in my libs folder When I generate the apk , it gives the following exception [2014-05-03 ...
1
vote
1answer
253 views

Dynamic 2d terrain loading / stitching in Unity [closed]

I'm currently working on a top down 2d game (in Unity 2d) where I'd like to build a huge terrain for the player to explore. My question is - do you have any good practices or ideas on how to chunk the ...
4
votes
1answer
472 views

How to edit key-value pairs (like a Dictionary) in Unity's inspector?

I have a spell system I am creating, the principle is as follows: Each spell is an autonomous prefab. It contains a script with some properties (base damage, duration...) that can be modified in the ...
1
vote
1answer
118 views

How can I unify the collision handling of melee/spell attacks in a networked environment?

I am trying to figure a good way to create the battle system of a game. The game is fast paced and the gameplay needs to be precise (think hack n slash) What I would like to achieve is a simple and ...
0
votes
1answer
61 views

Unity what are the rules for determining sizes of gameobjects

I am making a game for windows phone. I am a newbie so currently I am unable to understand if I have to make a simple menu for a game targeting portrait mode always, what should I give the background ...
1
vote
2answers
179 views

How to change transform.position.x after a state is changed?

When I press attack button, player will change to Normal Attack state to perform Normal Attack animation and you will notice the player seem like step back a little bit as the width of sprite for ...
1
vote
2answers
173 views

Unity3d not allowing endpoint to save cookies

So I'm using an external DLL with Unity to login to a web service and access functions from it. The DLL works perfectly fine in a command prompt project, but when run in Unity I can log in ...