Tagged Questions

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
0answers
4 views

Using RPC's for movement of an object across a network

I've been building upon http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php At the moment when I spawn a sphere on the server it spawns on the ...
0
votes
0answers
9 views

how to write the logic for onFling using unity c# or js script

I want to rotate the wheel by using onFling gesture.
0
votes
0answers
41 views

Unity How to stop a jump?

transform.Translate(Vector3(horizontal * speed * Time.deltaTime, vertical * speed * Time.deltaTime ,0)); Im new to unity and Im asking how to stop a jumping, cause if I turn on this script on char ...
0
votes
1answer
37 views

How to make an object that has no rigidbody2d component smoothly fall on the ground in Unty2d?

I have two character in my game: enemy and main character. Enemy can throw different objects into the main character. For this moment i am doing this action in such way: void FixedUpdate(){ if ...
0
votes
2answers
47 views

When would a mesh collider be better than primitive colliders

I have been reading through the Unity Manual and have come across some interesting information about mesh colliders and primitive colliders. It got me wondering if using many primitive colliders would ...
0
votes
1answer
54 views

Finding next AI move using MinMax algorithm for Checkers [duplicate]

I am currently working on a Checkers game using Unity ( human vs computer ) I am done with the base architecture of the game ie defining the rules, moves, jumps etc. I am currently stuck in ...
0
votes
0answers
25 views

Method Animator.SetBool sometimes is not working (or not triggering) in Unity2D

I have trouble with Animator in Unity2d. I have a main character for my game. The character has his own animation clip for fighting. When the player touches the screen, i am starting animation. When ...
0
votes
1answer
60 views

Unity 2D Game Development [on hold]

How do I make a sprite swing an object, like a sword, without having to animate the sequence. I'm thinking I need to rotate an object around a point over time.
0
votes
2answers
67 views

How unity works on Web

How Unity can work on Web if the code is written in C#? I understand that you can compile the C# code to a shared library and use it in Java (for Android) in ObjectiveC (for iOS) to enable Unity on ...
1
vote
1answer
46 views

Draw Primitives with Unity 2D

I would like to be able to draw primitives in unity 2d to define my game objects. I have tried the following example: using UnityEngine; using System.Collections; public class ExampleClass : ...
0
votes
1answer
37 views

Spawning a Sphere and trying to move it

I've been trying to build upon a blog post on Gamasutra http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php In this I would like to spawn a ...
3
votes
1answer
75 views

How do you make specific collisions in Unity?

So I have created a "game" where you are automatically running across platforms and you can jump and land on the top of them. I want to set it where if you collide with the the left and right side of ...
0
votes
1answer
122 views

How to make the damage inflicted to the enemy and the main character more unpredictable

I am developing a small mobile game. The enemy can damage my player by throwing objects at his side, and the player can damage the enemy by hitting him with a bat. For the moment, I am calculating ...
-1
votes
0answers
64 views

3D Game development in Java [on hold]

I've searched for 3D Game development in Java and I've came across a few libraries but they don't seem to have good tutorials. I've came across: Java 3D(Good tutorials but I've been told that it ...
0
votes
2answers
43 views

Collisions are not working in Unity [on hold]

For some reason my collisions are not working. This is what the code I have. void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "wall") Debug.Log ("It worked"); } When my ...
0
votes
0answers
21 views

How to play only a part of animation in Unity 2D?

I want to make a progress bar in my game for show the amount of collected item in my game. I designed a animated sprite sheet from empty amount to full amount of the progress bar. My Question is: ...
-1
votes
0answers
13 views

NGUI and Unity Sprite Renderer [on hold]

I have problem when I using NGUI and Unity Sprite Renderer. When I touch button in NGUI, it occurs problem. I want only ngui actions but occurs both actions. How can I fix this? Thansk.
-1
votes
1answer
42 views

How to temporarily disable input?

I have made a jump script and I want all input to be ignored when you are in mid air (so that way you don't have infinate jumps). How to do this?
0
votes
1answer
35 views

Sending RPC calls from server to client inside Unity

In my game inside Unity, I have two scenes setup. One for the main server ( acts like authoritative server ) and the other scene for my client. The game starts once my client connects to the server. ...
1
vote
2answers
100 views

How do I create the visual effect of transitioning between night and day?

I am making an open-world project in Unity 4.5.5 and I want to create a visual effect of transitioning from day to night? The Legend of Zelda: Wind Waker HD has a great example of such a transition. ...
0
votes
2answers
62 views

How do I have a camera follow my object in Unity?

I have an object that automatically moves by itself and I want the main camera to automatically follow it.(Like in games such as geometry dash and jetpack joyride) This is the code for the automatic ...
0
votes
0answers
22 views

Passing random number parameter to RPC call inside Unity

So I have posted a similar question previously but this is more specific to actual code that I am trying to implement for a multiplayer game that I am working on for IPAD. In short, this will be a ...
0
votes
0answers
17 views

InvalidCastException: Cannot cast from source type to destination type [closed]

I have fetched the data from xml and stored it in an array.I have coded as below private var timearray:Array; private var distancearray:Array; private var distancedata : String; private var timedata ...
0
votes
0answers
22 views

Rewriting the existing code for RPC in Unity

So I am basically done making a game inside Unity. The next phase is for me to make the game run on different IPAD devices ( max 4 ). So the main game would run from a PC which would act as a server ...
0
votes
2answers
49 views

c# Unity - Matrix output incorrect on vector rotation

I have a input Vector (1,1,0) when I run it through a Unity Matrix4x4 class with a rotation of 90 degrees around the Z axis the output is (-0.9999999,1,0) which is nearly correct but strange. But ...
1
vote
1answer
75 views

How to animate clouds [on hold]

I am creating an open-world in Unity 4.5.5 and I do not know how to make the clouds move. This video of The Legend of Zelda: Wind Waker HD is a perfect example of the clouds moving in the sky. How can ...
0
votes
1answer
75 views

How can I allow players to draw decals for their avatar and items?

I want the player to be able to draw a simple symbol, even if it's pixelated black or white, that their character can have on their weapons, armour, forehead or even markers and monuments. How would I ...
1
vote
1answer
33 views

How to mirror flip animation curves in Unity?

I have a animation that moves my camera from left to right. Now I'd like to copy it with 'mirror' transformation so I can use it to move from right to left. Is it possible to do it using script or ...
0
votes
0answers
26 views

How can I use different fonts for different objects in Unity?

In Unity 3.5, I have a font that is strangely linked to four game objects. I want to put separate fonts on each object. In the Inspector, when I click on the circle icon next to the "Text" ...
0
votes
1answer
30 views

Trigger scene loading in one device from another device using Unity WWW class

I have a master device and client device. I want to load a scene in the client device by pressing a button in the master. My method is, when the button is pressed in the master device, a data is ...
0
votes
0answers
23 views

How to upload binary image data via POST in Unity through load balancer?

I want to use unity to upload POST binary to the server. However, my server used HAProxy and it triggered an error "The remote server returned an error: (417) Expectation Failed.". The cause of ...
0
votes
0answers
36 views

Choppy Character Movement Unity 2D [closed]

I am new to game development and have been following a tutorial to get started, it is a flappy bird style game. My main issue at the moment is when tapping the screen to move my character it is ...
2
votes
0answers
36 views

Why is OnCollisionEnter2D called when it's layer's collisions are being ignored?

I'm sure this is down to my lack of understanding of the unity physics system. I'm trying to implement a simple one-way platform for a 2d game and have got stuck on creating a reliable way to let the ...
0
votes
1answer
34 views

Copying a texture's colors to a new texture to create a new sprite

Let mySprite be some .PNG sprite: Texture2D tex = mySprite.texture; Sprite sprite = Sprite.Create(tex, new Rect(0,0,tex.width,tex.height),new Vector2(0.0f,0.0f),1.0f); The resulting sprite can be ...
0
votes
0answers
10 views

Unity 3.5.7f6 font style of one object is linked to another object [duplicate]

I'm using Unity 3.5.7f6. When I edit the font style of one text area on one object, it changes another font style on another object to the same font. Is there a way to break this bond/link of font ...
3
votes
2answers
130 views

Find a position within one radius, but outside other radii

I have an Object A which will attempt to stay within a certain distance of another Object B. I would like Object A to also try to stay outside a certain distance of one or more other Objects R. The ...
0
votes
1answer
37 views

Getting the Halo property of a point light in Unity

I am adding point lights in my scene ( max 6 ) and I want to be able to enable its Halo property via script. However in the documentation reference, they haven't mentioned how to enable the halo ...
-2
votes
1answer
57 views

How do I position a cylinder between 2 points? [closed]

I found this code to draw a line between two mouse points. I want to do the same, but inverted; going in the other direction. The line should get larger from my first point toward the second. None ...
0
votes
1answer
50 views

How to combine the camera that follows the player and the camera shake effect in Unity?

I need to combine both camera that follows the player and the camera shake effect in the same moment. The problem is in that, if I make the shake effect for the camera, then the camera doesn't follow ...
0
votes
1answer
73 views

Alternative to Update()

Here is my noobish scenario I'm trying to understand: Some class, Terrain: void Start() { ... switch (Type) { case TerrainType.StartPoint: ...
0
votes
2answers
97 views

Avoiding singletons for puzzle system [closed]

Say for instance I have a puzzle with 3 switches that need to be in some configuration (say all on) in one room, that opens a door in another, with a load screen separating, so I can't link the ...
2
votes
1answer
66 views

How can I access a script variable from another script in Unity?

I'm creating a space shooter (think Space Invaders or Galaga) where the GameManager persists between scenes but the player and enemies don't. I need to access a boolean value from the player and ...
0
votes
0answers
11 views

How can you duplicat folders and not share old dependencies in Unity?

I have a folder with some prefabs, materials, textures, FBX, etc. My Prefabs refers to FBXs and Materials in this folder. Can I clone this folder in a way that it will save those local dependencies? ...
2
votes
2answers
95 views

Calculating gameObjects hit by a directional light source

I am trying to figure out in my current game whether a gameObject is lit by a directional light or not. Below is my image inside the Unity game engine As my game runs around a Day/Night cycle, I ...
0
votes
0answers
37 views

Create a sprite in Unity that has a border that does not change its width when scaling

I am trying to create a box that has a 10 pixel border and when I scale that box I would like the border to stay 10 pixels no matter the size. I am currently trying to create an empty game object ...
-4
votes
1answer
66 views

Move an object based on XML/TXT file [closed]

Let's think I have an file which looks like this: 0 1 2 3 4 5 6 7 8 9 10 11 I want to create a move from this file. For every 1s(mentioned in the file) I want to move the object. Is this ...
0
votes
2answers
98 views

I want to show total time spent by all players around the world in my game

I am developing a Unity3D game. I want to show in my game: Total time spent playing all time by all players around the world Total time spent playing in last 24 hours by all players around the world ...
0
votes
2answers
90 views

Unity yield WaitForSeconds() not working

I am new to Unity development. I started learning Unity by reading tutorials, demos, examples, and watching videos. And I am having some trouble with using this timer. Here is my code: void ...
2
votes
1answer
91 views

How to share values between different shader programs?

I am using Unity but this might concerns all type of shaders. I would like to know if this is possible to share values between different shader pass.Let's imagine that I am computing something in the ...
0
votes
0answers
84 views

Creating a arc path connecting two GameObjects in Unity

I am working on a game on a spherical surface which first of all is a big challenge in itself. I want to create a path on an arc which connects two points ( seen in the image ) and show an arc path ...