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)

2
votes
2answers
96 views

Make camera follow and rotate with player without childing it

I want to have a camera, that follow the player, without childing it to the player object. So far I have this one line, that follows the player, but does not rotate with it (meaning the camera should ...
0
votes
0answers
21 views

Problem with coroutines unity 3d

I cannot understand why the coroutines are not waiting the designated number of seconds before executing the code below it. At the moment, the animation bleeds into the next state. I could get around ...
2
votes
2answers
66 views

why is my enemy AI is on air while moving?

In Unity3D I have created an enemy AI and applied a script for it to move and chase the player. But when moving, the enemy hovers in the air. My character also does not have rigidbody and he just has ...
0
votes
0answers
19 views

Build custom editor to UI elements

I want to add some extra functions to editor inspector for UI.Button but, I can't setup my script in this way :-/ How can I write custom inspector for UI Objects ? This is what I wrote: using ...
0
votes
0answers
21 views

Unity - Vector3.Reflect not reflecting correctly

I resolved the question on how to draw a line, so here is the result: https://www.dropbox.com/s/hvc9yr3jjbqdv7r/dc.jpg?dl=0 So, now I want to create a line that shows the possible bounce off the ...
1
vote
2answers
35 views

Character controller passes through mesh collider

I need a little help figuring out what's going on with an NPC's character controller. Here are the character controller settings for the NPC. The problem I'm running into is that the NPC isn't ...
1
vote
2answers
38 views

Need help with physics 2D Unity

I'm making a 2D game in Unity. Basically there's just a rocket that goes where ever the user touches. With the code that i have right now, the rocket instantly rotates towards the point and moves ...
0
votes
1answer
16 views

Increasing friction or Adding force relative to transform position in Unity 2D?

Back again with a quick question! I have a few basic platforming mechanics going on in this scene. I have a prefab platform with an animation that loops back and forth between two different x ...
1
vote
2answers
44 views

Unity 3D - Confine a gun rotation within certain degrees

I am having troubles making my gun rotate up and down, and have limits, for example, I want the down limit to be 0 degrees, and the up limit to be 90 degrees. Currently I can't figure out how to ...
2
votes
2answers
79 views

How to draw a line in 3d space?

I have a top down billiard game. And on click / tap the ball moves in the clicked direction like in the image below: Now, I want a line to be drawn in the direction where the mouse is hovers or the ...
0
votes
0answers
27 views

How should asset bundles be divided?

The only way to load an asset from an asset bundle into memory is to load the entire thing, decompress and pull out the asset you want, then unload the entire thing, except the assets you want. This ...
1
vote
2answers
33 views

Vision Cone for Enemy AI in Unity 2d

I am trying to develop an Enemy AI with vision cone in unity 2d top down game, can you please suggest me some approach or sample script, so I can get an idea.
1
vote
2answers
139 views

Render sprites onto a virtual 640x480 “screen”

I'm making a game, and in part of it, the player uses a computer terminal. I want to draw to a virtual 640x480 screen with pixel precision, and then draw that "virtual screen" to the player's real ...
-1
votes
0answers
29 views

Water gets really dark when camera is far away

I'm trying to create an over view map of a whole world, but I'm having lighting/color issues with the water. When the camera is high up, it's really dark: When it's lower: My workspace:
0
votes
1answer
45 views

The more appropriate way to find GameObject in the scene

Which way is the more appropriate to find GameObject in the scene. I know that GameObject.FindGameObjectWithTag is faster than GameObject.Find but i wondering whether FindGameObjectWithTag is better ...
0
votes
1answer
25 views

Why does my code only work when there is a debug statement? (Unity)

I have a script that controls how the particles in a particle emitter should look. (XNA example here) Yet it doesn't seem to update correctly. With an orb that should have 50 particles only a few ...
1
vote
0answers
11 views

Unity Engine: How to change mointor/desktop resolution in 4.5.3 and higher

As of unity 4.5.3, Screen.SetResolution and the Unity Resolution Display Dialog, by default, no longer change the monitor/desktop resolution. Instead, it only changes the render target resolution for ...
0
votes
1answer
15 views

Rotating 2D-Projectile towards mouse, hides the projectile (Maybe changes the layer)

I want to shoot towards my mouse, which is working fine now. After this was solved, I wanted to rotate the projectile, so that it's looking to the mouse. This is my code: projectile.transform.LookAt ...
2
votes
3answers
47 views

Unity - Check if object is facing Vector3 coordinates

I am having a hard time figuring this out, I want to have objects that move around randomly, and when they get new coordinates to move towards, face them, and then move. Here's explained: Target ...
0
votes
0answers
53 views

How Can I Make These Collisions Work Outside Of Unity's Built-In? (C#)

I'm having some trouble working out what's wrong with my code. Basically I want to have my player be able to collide with obstacles it's flying through. So I have an obstacle, and a pathway or two ...
0
votes
1answer
25 views

Uncontrollable platform spawning

I made simple spawner like this: void Update() { if (PlatformPosition.spawnNewPlatform) { NewPlatform(); } } public void NewPlatform() { if (active) { newTransform = ...
0
votes
2answers
43 views

How to use Input.GetAxis(“Mouse X/Y”) to rotate the camera?

I want to make a first person camera that rotates with the mouse. I looked at the Input.GetAxis Scripting API page and found a sample code, which I have included at the bottom of my post. Upon trying ...
0
votes
1answer
32 views

Making certain GameObjects visible for a camera

I have 2 cameras in my 2D game. One displays gameobjects normally, and the other camera draws some of these gameobjects reflected (scale.y *= -1). The reflected camera would draw only objects in the ...
0
votes
0answers
16 views

show different color areas of image on touch

How do I show colors filled in on a colorless version of an image on user touch. (for example color mania or guess the colors app). I know one way is to provide the same image 3 times (for 3 colors) ...
1
vote
2answers
51 views

Waitforseconds is skipping over

I have a function for a timer using waitforseconds but instead of waiting for how long I want to, it just skips it. A ui text should become "foo" then 5 seconds later become "bar" but it turns to ...
1
vote
2answers
27 views

Get the current time of animation using script Unity3d

I want to know the current time of the played animation using script in Unity3d. I tried using currentState.normalizedTime but this time is not the time of the animation, like it's the time of the ...
1
vote
1answer
74 views

My bullet changes the velocity depending on where I click

I want to build a little 2D-Sidescrolling shooter and I'm now at the shooting script. I already figured out how to shoot a bullet towards my mouse pointer. I got something like this : Vector3 ...
-2
votes
0answers
14 views

Android unity Build error [on hold]

i add the admob in my unity project i got this error Error building Player: Win32Exception: ApplicationName='javac.exe', CommandLine='-bootclasspath C:/Android/sdk/platforms/android-21\android.jar" ...
0
votes
2answers
57 views

Orthographic Camera settings for a 2D game

I'm starting out a 2D wrestling game in Unity 5 and i need some help. The default resolution of game needs to be 320x240. The background sprite that i would be using is 640x480. The camera would move ...
0
votes
0answers
15 views

On which platforms does Unity support dynamic linking?

Unity3D allows me to import .dlls and execute the code they contain. However Unity supports a range of platforms, each with varying features and requirements. As such they have varied their approach ...
0
votes
0answers
28 views

How should I organize multiple materials?

I'm making a tile-based game, in which many tiles will be of the same type, and so I want to avoid having the same texture for all of them. I'm thinking of having multiple textures for those widely ...
7
votes
2answers
569 views

How can I model a star?

I'm trying to model a star in Unity, and it, sort of works, but it's not ideal. Currently, I'm using a large sphere with a self-illuminating material containing a star texture applied to it's surface, ...
1
vote
0answers
41 views

How heavy is a scene load in Unity assuming all referenced objects are in memory?

From what I understand, resources that are local to a particular scene( not a prefab, or texture, material asset etc ) are embedded in the scene file itself, while external resources are just ...
1
vote
0answers
16 views

How do I force Unity to reload editor scripts

I am working of some editor scripts for Unity but have found that it is difficult to force Unity to reload my editor scripts. My scripts are modelled on the static constructor approach and perform ...
1
vote
2answers
52 views

Preventing a Combination of Rigidbody Jump Force & Bounce Magnitude in Unity3D

I'm building a fairly simple marble racing game in Unity3D. The ball is a 3D physics object that moves only on the X and Y axes. It has the ability to roll left and right, and to jump. Pretty basic ...
1
vote
3answers
80 views

Creating interiors in Unity

I'm trying to use the vanilla Unity Editor to make some interiors (with primitives like cubes etc). It's a hard process by itself because you have to do all sorts of calculations for scale and ...
0
votes
2answers
61 views

Unity 3D, Making contiguous looking worlds

Im currently involved in making a third person cooperative mobile game in Unity and in said game there will be an area for players to walk around in with various elevations and whatnot throughout the ...
0
votes
1answer
32 views

How can zoom into my object when that object is being clicked?

Suppose that I have the three game(cube,Quard,sphere) object. When I click on a particular game object suppose think I have clicked on the cube,the cube object should get zoomed in on the screen. how ...
-4
votes
1answer
32 views

What you think about Digital-Tutors? [closed]

I want to ask if there is any one try Digital-Tutors site as content i see it's very good but i want to make sure before i rush into it .
0
votes
0answers
12 views

Unity - Decrease/Increase the “Z axis” angle axis on Update()

What is the best way to Decrease/Increase an angle without using "eulerAngles"? I need turn my transform between 30 and 325, according to my "Y axis". If it is less than zero we reduce the value of ...
-1
votes
1answer
21 views

Unity not showing full text

This is simple issue, I'm trying to put in text, but it keeps cutting off, I found nothing in it's settings for text limited
0
votes
1answer
37 views

Game maker or unity for 2d games [closed]

I'm new to game dev but I know how to code. I would like to try my hand at making a 2d game. I am overwhelmed by the ear between unity and game maker. Which one would be better to use. I thought unity ...
0
votes
2answers
43 views

How to load scene after a set delay?

I have tried using IEnumerator and Invoke("method",delay_in_seconds). My first scene is just an image with my studio name on it. I have script that will load the next scene ("Main Menu") 3 seconds ...
3
votes
3answers
144 views

How to create custom 3D “areas” at runtime

I've been puzzled for a few days trying to solve this problem, so far with no results. On a map, currently a Terrain, I'd need to have some "areas" which can be controlled by a specific players. The ...
0
votes
1answer
4 views

Animation package from Assert Store not working probably with Unity Model/Custom Model?

I downloaded the animation pack from here: https://www.assetstore.unity3d.com/en/#!/content/25794 The assert contains a fbx file, which contains a bunch of animations. Then in Animator window I added ...
0
votes
2answers
36 views

How to access Collider in c# script with its tag name

I want to access a Collider in c# script file with its tag name I Tried this if (Collider2D == Physics2D.OverlapPoint(touchPos)) { Some Code to be Performed } I want to access this Collider2D ...
0
votes
1answer
75 views

Need help with Physics

I'm using Unity to develop a game. Basically i want the player/rocket to follow a point on the screen where user touches. But It's based on physics. Force must be added when user touches somewhere and ...
0
votes
3answers
39 views

Calling and functions/methods from different Classes in Unity

I am learning some of the basics with Unity and am running into calling/sending code to a different script. For example, the code below is a basic menu of options. I have a different Scene set up in ...
-1
votes
1answer
37 views

Get current position of instantiated prefab

I wrote two little scripts to manage platform spawning. 1st - is attached to the Spawner gameObject. It's uset to spawn new platform. 2nd - is something like Platform Manager which not extend ...
0
votes
1answer
40 views

Random movement of game Object staying in a circle

I want to write a script which makes several objects move in a random direction but within a range around another game object. If the parent object moves then that range should also be changed ...