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 (2)

3
votes
1answer
59 views

How can I search for players in the same wifi in Unity?

I am creating a game in Unity and I would like to create an ability for players to join the game that others have created on the same wifi. I would like it to be as effortless as possible(e.g. players ...
3
votes
1answer
62 views

How can I create “events” that are called in scripts without requiring subscriptions?

I am creating an editor extension that includes an API for developers to use. It also includes events like (for example) "OnHealthChanged." The problem is that events I have stumbled upon would ...
0
votes
2answers
58 views

Handling accelerate in different devices

I am adding tilt controls to my game. The sensor values I get are different in different android devices which results in random behavior. Anyone knows how can I tackle this situation? I tried ...
1
vote
0answers
22 views

Unity 3, TouchScript - Detects touch position each time it changes position

I have a big problem here. I am making a script to detect a circular swipe, so I need to continually detect a touch position that keeps a magnitude and that the angle is relative to the former angle ...
2
votes
1answer
237 views

Unity - Autoscroll when selecting buttons out of viewport

I have a ScrollView element, that contains many buttons. I want that when I select buttons (via arrow keys), the panel scrolls so that the selected button is contained within the viewport. How could ...
1
vote
2answers
99 views

FBX animation works in 3DSMax but not with Assimp [closed]

I have an FBX file that represent a plane with an animation of the gear opening. In my editor 3DSMax or in the Unity editor, the file and animation seem good, but when I use Open 3D Model(the official ...
0
votes
1answer
107 views

Unity3D - Android build has no Internet Access

I'm having trouble connecting to the internet in an Android build. I created a simple program that checks if there is an connection. Also I set in 'Edit > Project Settings > Player' the Internet ...
1
vote
0answers
40 views

Collision Detection between two instances of the same Prefab

I am a trying to recreate the first stage of Super Mario Brothers, but I am having a bit of trouble with the collision system between Koopa Shells. I have written two different scripts in hopes to ...
3
votes
2answers
277 views

How to organize level blocks in an Infinite runner

I'm working on an Infinite Runner game. I have created many level blocks(sections) with different obstacles and pick-ups for the player. They are positioned and placed manually, in such a way, to give ...
4
votes
1answer
149 views

How do I apply domain warping to my marching cubes voxel terrain in Unity?

So, in GPU Gems 3 there is a cool warped terrain that i seek to replicate. Currently, I'm generating the terrain fine, but I want to add that warp effect. // Do this before using 'ws' to sample the ...
0
votes
2answers
170 views

Picking a 2D Box Collider with the mouse in Unity

I have a scene with a bunch of 2D doors that have 2d Box Colliders (no trigger) on them and that live on a Canvas. I would like to be able to click on them with the mouse, but have had no luck. ...
2
votes
2answers
1k views

Can't clip a sprite that has a custom shader in NGUI

I am using NGUI. I have an "NGUI Unity 2D Sprite". This sprite has a material with this shader: Shader "DM/Ripple Shader" { Properties { _Color ("Color", Color) = (1,1,1,1) ...
0
votes
1answer
131 views

Unity3D - post-process unwanted on UI

I have scene rendered with a single camera using target texture (a). Second camera is used to render UI and using same target texture (a) as the first one. Third camera takes target texture (a), ...
-4
votes
2answers
93 views

Distance between the player and another object Unity

Edit: I want to find the distance between the player another object. How do I do that? this is what I tried: public GameObject other; void Update() { float dist = Vector3.Distance(other....
18
votes
4answers
2k views

Saving player's progress in a Unity game

I am making a game using the Unity game engine. I want to save the player's progress including level, experience points, chosen character, etc. Presently I am using playerprefs but I want to know ...
0
votes
2answers
106 views

Use constant force to hold something in position

This may actually be more of a Physics.SE question but since im doing this in Unity I figured I'd ask here. I am playing around with the Constant Force component and have a sphere constrained with a ...
0
votes
1answer
63 views

Unity 2d sprite repeated as background

I'm a web developer with over 12 years of experience and I'm moving my first steps in game development in the latest days. Specifically I'm playing with Unity and trying to understand how it works and ...
1
vote
1answer
67 views

How do I convert gravity from pixels per frame² into Unity's Rigidbody2D gravity scale parameter?

I'm learning Unity2D by trying to make a Mega Man clone. The first thing I'm trying to do is to replicate the original series physics. It differs from game to game, but I'm leaning towards something ...
0
votes
1answer
97 views

Object spawn only on Server in multiplayer unity3d game

In my game I have an object let say food, whoever eat that food that player will spawn one more element. I am sharing code here :- I am checking collision in Update. Following code is working fine on ...
3
votes
1answer
160 views

Increment grid by rotation

I'm currently working on a grid for snapping objects side by side. My current script is working fine, but only for game objects which haven't been rotated. Here is an example video of the problem: ...
0
votes
1answer
37 views

Unity / How to add a shader to a material via c# script?

I found already some things - but those seem not quite what I need. (perhaps outdated functions?) https://docs.unity3d.com/ScriptReference/Material-shader.html here, it seems you can add a shader to ...
0
votes
1answer
84 views

How can I instantiate in the current rotation in Unity 2d?

Backstory I'm currently working on a 2D sidescroller/platform game as a hobby, and I just started recently. Followed a few tutorials and such I managed to wrote my own code for basic command like ...
0
votes
1answer
64 views

OnApplicationPause()/OnApplicationFocus() in Android/IOs

I searched in Unity Documentation but there are no information. I'd like to know which methods is called and what it returns in the following scenarios on Android: App initially starts App goes in ...
2
votes
3answers
522 views

Camera follows player but how to stop camera moving when player moves

The player is moving automatically diagonally down the screen, and I have the camera as a child on the player. I would like the camera to always be following the player (who sometimes slows down / ...
0
votes
1answer
269 views

Sending message to all players in room from Photon server?

I need to send a message to all players in the room from a Photon server. Sending the message from a player would introduce too much latency so I need the server to collect data and distribute ...
2
votes
2answers
48 views

Isometric map black screen

I am trying to create an isometric map and I am very new to it. Please see the attached example map. While rendering it I've noticed that when my actor reaches the edges of the map the player can see ...
1
vote
2answers
36 views

Implementing an interaction system that can perform different tasks dependant on the object you are trying to interact with?

In No Mans Sky there are objects to interact with in the world and the result of the interaction changes depending on the object. For example, if you interact with a plant it will give you resources ...
1
vote
1answer
637 views

How to import animations from one model to others

I have two models (one animation in each) which I got for free from Mixamo. I imported them in Unity and they look like this: http://imgur.com/atjQbkI Justin@Idle and Justin@Walking. As can be seen ...
0
votes
1answer
172 views

Game states & passing data between scenes

I'm not entirely sure if I'm doing this right, but I always considered the scene system in Unity as some sort of state management (rather than e.g. a level system) which allows to group the contents (...
2
votes
1answer
78 views

Unable to save player data in a binary file within Update() method

I'm trying to save player life within a binary file in Application.persistenceDataPath. I've written a method to store the player life: public void SaveLife() { BinaryFormatter bf = ...
1
vote
1answer
37 views

why the camera won't rotate around my object?

im new to unity scripting, and now am building upon "Roll a Ball" example in unity training. I wanted to make the camera rotate around the ball in the scene in Y axis, when mouse is moved, and watched ...
0
votes
1answer
18 views

Animator consecutive set parameter problem

I'm having a little problem with my animations transitions. I have this diagram: http://imgur.com/Se8Ix1L My transitions is made by updating the parameter "stateparam". My code, changing the ...
1
vote
1answer
30 views

IgnoreCollision while Dodging & Colliding

I'm working on a mechanic to allow the player to dodge through enemies. However I'm running into the issue where the player is only able to dodge through enemies while their already dodging when they ...
0
votes
1answer
67 views

A panel to change 3d object properties when right click on it (Unity)

I'm building a UI system to edit selected 3D objects. I have spheres on the screen and I want to be able to edit their proprieties (radius for example). In order to do that I want the user to be able ...
1
vote
1answer
849 views

Unity UI Input Field suddenly malfunctioned

I'm using Unity 5.0.1f1, and my UI Input Fields are not working as they are supposed to. I have an Input Field that is placed in a Panel and inside a Canvas. It has a Text component in which I can ...
2
votes
3answers
211 views

Are loading screens more important than they appear to be? [closed]

I am creating a game in Unity that is really low poly and uses few resources on mobile. It runs quite fast on old, low end phones so the new, high end phones have no problems running it. There are no ...
3
votes
1answer
760 views

Avoidance Steering Behavior acting inappropriately

I've been trying to implement this steering behavior in Unity: Understanding Steering Behaviors: Collision Avoidance However, I'm getting strange results. Here's the code for the script, feel free to ...
1
vote
1answer
97 views

Unity2D Isometric layering

I'm developing an Isometric Game but I have problem apply the right layer for make, for example, a wall behind or in front of the Player depending on the Player position. I'm able of getting works in ...
1
vote
2answers
52 views

Unity - Check if sprite is within range around player

I need to know if a sprite is within range (circle or square doesn't matter) around the player. If the sprite is, let's say, 100 blocks away from the player, I will disable it. This wouldn't be too ...
0
votes
0answers
13 views

Unity 2D Torque at position [duplicate]

I'm working on a 2D space game in Unity, and I wanted to include ships that might have reaction wheels centered around places other than the center of mass. If so, I'll need to be able to apply torque ...
0
votes
2answers
105 views

Positioning 2D (non-UI system) game objects

As an old Flash dev I'm slightly confused about how you position game objects on the screen in Unity since game objects have no width or height (only a scale). Let's say I have a container gameobject ...
1
vote
3answers
67 views

Unity random.range value not same as last value

Quick one, Currently using Unity Random.Range to set a var with the value of an enum state. State has 4 possible values, up, down, left,right. I call it like : currentState = (StateType)Random....
-3
votes
1answer
66 views

MMORPG networkconnection like Vindictus [closed]

to be honest, I like to make "small" MMORPG with my frends. We are 4 guys and are using Unity3D and Blender. I am a Programmer and I am using Eclipse. I know, it's silly to start a Question like "How ...
1
vote
1answer
1k views

What is the proper way to get input from the motion controllers touch pads?

I've been trying to figure out how to get the inputs from the touch pads on the motion controllers but have yet to find out how to do so. Initially I tried doing the following (as it was how I ...
0
votes
1answer
49 views

canvas screen space camera rotation issue

I have a canvas on a camera set to it's screen space (not as a child of the camera) I have my camera rotate on the y and x axises but whenever I move it on the x axis (up and down) the canvas doesn't ...
0
votes
2answers
47 views

Why does Unity allow me to use GameObjects created from non-existent prefabs?

I have code similar to the following in a Unity project. I was trying to shoot a projectile when spacebar was hit, but a projectile wasn't appearing. I found out the problem was caused because I moved ...
2
votes
2answers
158 views

Unity : callbacks in component based design

I am trying to use component based design in Unity3d v5. If I have 2 separate C# scripts attached to enemy ships like below: Script1.shipDead() - Remove game object and show explosion animation ...
0
votes
2answers
77 views

Is Unity + Scala.js possible or even makes sense?

I never actually used Unity (yet) and I have no possibility to check anything now, but I'm thinking about Unity for my project. I actually know C# (and hate it for some unimportant reason) and I think ...
0
votes
1answer
52 views

Unity WebGL build throws errors

I am working on a multiplayer game for WebGL platform and i am using (http://lockstep.io/ - SocketIo & node.js server ) for handling the game. I am facing these issues as shown in the attached ...
1
vote
2answers
132 views

Do I need a server to connect two players in a mobile game?

I would like to make a 2 players app game, where 2 players can compete with each other in real time. If I want the player to be able to compete with the public (anyone who registered with my game ...