Unity general questions

Comments

  • Tuism said:
    Are you referencing the camera via Camera.main?
    Yep. Still says that the GameObject has no camera attached.
  • I just threw together this in a new scene and it worked:

    if (Input.GetMouseButtonDown(0))
    		{
    			Vector3 p = Camera.main.ScreenToWorldPoint(new Vector3(100, 100, Camera.main.nearClipPlane));
    			Debug.Log (p);
    		}


    When I had "camera" instead of "Camera.main" it threw the error you were talking about. So.... That should be the problem.
    Thanked by 1CiNiMoD
  • edited
    Tuism said:
    I just threw together this in a new scene and it worked:

    if (Input.GetMouseButtonDown(0))
    		{
    			Vector3 p = Camera.main.ScreenToWorldPoint(new Vector3(100, 100, Camera.main.nearClipPlane));
    			Debug.Log (p);
    		}

    Im not by my PC now, but I think I know what the issue is! I blame it on 2am coding :P I think I was saying gameObject.Camera, which of course wouldnt have a camera :P

    Thanks :D
  • CiNiMoD said:
    I am trying to get the cursor position in world coordinates. Now I know how to do this with the camer.ScreenToWorldCoordinates, but on the game object I am using it says that there is no camera attached?
    The Component.camera property is really just shorthand for GetComponent<Camera>(). This is the case for all the other shortcuts such as Component.transform, Component.renderer, Component.collider etc.

    Your camera property is looking for a Camera component attached to the same GameObject, that's why you're getting that error.

    @Tuism's solution should work provided your Camera component is on an object that has the "MainCamera" tag. Otherwise you will need to get some reference to the Camera component you want to use for your calculation.
    Thanked by 1Fengol
  • Wait what? I thought Camera.main is just always automatically the main camera, am I wrong?
  • @Tuism: And how does Unity know which camera is the main camera? It looks for objects tagged with "MainCamera". Unity gives you such an object whenever you create a new scene, so you've probably never even noticed the tag.

    http://docs.unity3d.com/ScriptReference/Camera-main.html
    Thanked by 1Tuism
  • edited
    So the camera field on any MonoBehaviour script points to a SPECIFIC camera that's attached to the same object that the script is on, not necessarily the camera that's rendering the game (since there could be many).

    Generally, you have a camera tagged as MainCamera in the editor (the default one should have it on for you). As @Tuism mentions above, you can access that specific camera with Camera.main.

    That said, though, camera.ScreenToWorldCoordinates may not necessarily do what you want, even for a 2D game. A point on the screen is actually a whole ray in world space, so you might need to raycast using that point to get a world space position that's meaningful to you, especially if Z is important in your game. In 3D, ScreenToWorldCoordinate is almost useless, and casting rays is really the only way to get something worthwhile.

    EDIT: Eep, this is what I get for not checking if I'm on the last page of the thread. Squid's pretty much covered everything, ignore me.
  • So I've got another stupid question :P

    I am trying to shoot a projectile towards the cursor from the character. I am doing this like this:

    Vector3 cursorPos = Camera.main.WorldToScreenPoint(Input.mousePosition);
    Vector2 direction = new Vector2(cursorPos.x, cursorPos.y) - gameObject.transform.position;
    direction.Normalize();


    Im pretty sure thats how you're supposed to do it, although Im no Unity expert, and Im not sure getting the cursor position is right, or am I missing something completely stupid here?
  • @CiNiMoD: Shouldn't you be using ScreenToWorldCoordinates instead?
  • dislekcia said:
    @CiNiMoD: Shouldn't you be using ScreenToWorldCoordinates instead?
    Sorry, typo, thats what I am doing and its not working :/
  • Hey guys,

    So I've been playing around with Unity and things have been going OK. My little prototype is kinda getting there, but I have one issue. I cant understand how this flipping camera works :P

    I come from an HTML5 background where we are expected to make things "responsive". Its fine because we can just position things by absolute values, or percentages if we want them to scale. Lets say for example that I have a game that I want to be 960x540, then a background that will just fill the current view, how can I achieve this in Unity.

    I am using a 2D scene.

    Thanks,
    Dom
  • Hey guys, here's something that seems simple :/

    I'm using [System.Serializable] to organise public variables in my inspector for sanity.
    But I also want to use the variables across scenes, so I use static.
    Apparently I can't declare them static in the class.

    But I also can't declare the variable that uses that class as static... Or at least when I do I get very strange behaviour.

    Is this, for example, the right way of doing what I'm describing? (that very last static in the last line causes strange Null Reference errors)

    [System.Serializable]
    	public class PlayerVars
    	{
    		public int playerNumber;
    	}
    
    	public static GameController instance;	
    	public static PlayerVars playerVars;


    Then usage:

    playerVars.playerNumber = 1;


    Does this even make sense? XD

    Thanks guys!
  • edited
    I hope I'm understanding your question in that you are attempting to create a set of global game variables that will be configurable through the Unity editor?

    As you have noticed, static variables are not serialisable/editable. The reason being that serialisable data is must belong to some particular instance of an object, while static data is inherently not. That is to say that there is no one GameController that has ownership of your playerVars data and as such there is no one GameController Unity can know to serialise that information to.

    The second error you're getting (NullReferenceException) is expected behaviour in vanilla C# and it's probably Unity's deserialisation behaviour that is throwing you off. In regular C#, when instantiating a new class, you'll notice non-struct (i.e. class) fields will always initialise themselves to null until specifically filled through either a constructor or some later method call. Unity's behaviour when deserialising objects that inherit from its UnityEngine.Object hierarchy is to fill out regular System.Serializable classes/structs with some set of default non-null information. Because Unity doesn't handle serialisation for static fields you are experiencing the normal C# behaviour. In short, static class fields need to be manually initialised before being accessed.

    But what you really want is a solution to what you're trying to do, which could be as follows:

    public class GameController : MonoBehaviour
    {
    	[System.Serializable]
    	public class PlayerVars
    	{
    		public int playerNumber;
    	}
    
    	public static GameController instance;
    	public PlayerVars playerVars;
    
    
    
    
    	private void Awake()
    	{
    		instance = this;
    		DontDestroyOnLoad(gameObject);
    	}
    }


    Usage:
    public class TestBehaviour : MonoBehaviour
    {
    	private void Start()
    	{
    		GameController.instance.playerVars.playerNumber = 1;
    	}
    }


    The two noticeable changes here to your existing setup is that PlayerVars is a non-static variable that belongs to every instance of a GameController. You can add this GameController behaviour to an object in one of your entry point scenes or wherever it may be applicable and edit it there. The second is that whenever this GameController object is created, either through instantiating a prefab it might belong to or loading a scene it is built into, it will register itself with the global GameController instance field. An issue to note is that if you instantiate or load scenes with multiple GameControllers the most recent one will be registered in the instance variable, knocking off a previously registered GameController and essentially leaving it dangling in the scene. These behaviour is also marked with DontDestroyOnLoad so that it will persist across scenes.
    Thanked by 1Tuism
  • edited
    Nevermind!!! I made a mistake, made it an instance of GameController instead of GlobalVars :/

    Doh! Thanks for the super detailed explanation and example!! :D

    Thanks for the explanation! I think I understand it... But trying to apply it, something isn't working and I'm not sure why:

    I've got this on an empty GameObject called Global, the script is called GlobalVars:


    [s]using UnityEngine;
    using System.Collections;
    
    public class GlobalVars : MonoBehaviour {
    
    	[System.Serializable]
    	public class PlayerVars
    	{
    		public int playerNumber;
    		public string[] playerNames = new string[11];
    	}
    
    	public static GameController instance;
    	public PlayerVars playerVars;
    
    	private void Awake()
    	{
    		instance = this;
    		DontDestroyOnLoad (gameObject);
    	}
    }[/s]


    But when I tried to call the variable up elsewhere (right now in a GameController script on GameObject - GameController, using a

    GlobalVars.instance.

    Well, actually, it doesn't register anything after "instance" - it's supposed to pick up playerVars and then playerNumber, right? So I should be able to use:


    GlobalVars.instance.playerVars.playerNumber

    Right?

    but I can't :/ Why...?
  • Maybe I'm overlooking something here but it seems you haven't assigned a value to playerNumber.
  • Hey guys :)

    I'm a billboarded SpriteRenderer to indicate feedback juice in a 3D game, but the sprite hides behind some of the 3D elements sometimes. How can I make it always render to top?

    My google-fu led me to this thread:
    http://answers.unity3d.com/questions/8220/rendering-order.html

    That talks about three things,
    1. Putting Tags {"Queue" = "Overlay" } in a Shader, which I tried, under the default tag, and it doesn't do anything.
    2. Set Material.renderQueue - which I tried, everything from a negative to a positive small value to a massive value, nothing. (I also read it must be positive for it to work)
    3. Turn of ZTest - how does that work?

    Not sure if any of this is correct? Halp?

    Thanks Guys :D
  • You can create a new layer "Juice stuff" and a new camera whoose culling mask is set to only render the "Juice stuff" layer and nothing else. Then you go and set that camera's rendering depth ("Depth") to 3 or 5 or something above the other camera's;

    Im not sure if that's the best solution though but I know it works :)
    Thanked by 1Tuism
  • I second Kobus. Its the easiest method that always works.
  • RAD! Thanks! That worked like a charm :)

    For anyone else who needs the same thing, you have to set the new camera's Clear Flags to "Don't Clear" too. Yay! :D
  • Does anybody know which Facebook SPK we need to use for Unity on Android?

    Cause there's one called "Unity Facebook SDK" and then there's "Android Facebook SDK". They don't like being together either.

    Any ideas?
  • Soooo I have a scene, the game (in Unity Editor or standalone build) always crashes when I use a Application.LoadLevel(0) (or whichever number it is in the scene, I've tried it as a 0 (adding a scene before it) and a 1).

    What could be the cause of this crash? That some values are hanging around from when the scene last loaded, that's conflicting with the reset?

    Is there a way to make sure a scene is reset completely when loading it? I just want a level reset :/

    I know I should manually initialise all the variables but omg that's a lot of stuff. Was wondering if there's a quick way about it.

    Thanks!
  • @Tuism are you sure you added the scene when building?
  • @Tusism what errors are you getting?

    Application.LoadLevel(Application.loadedLevel) will work to reload the current scene. However, anything in static memory and any objects marked with DontDestroyOnLoad will have to be manually reset.
  • You must add the scene in the build. With the scene open. [File] [Build settings] [Add current] e.g "Game"
    Then in the code all you have to say is.

    Application.LoadLevel("Game");
  • Sorry for the late reply guys, I was away for the weekend.

    I did add the levels into the build... So that wasn't the problem :/ I'm not getting any errors, it just straight up crashes dead. I haven't marked anything with DontDestroyOnLoad, would it ever automatically mark anything persistent without my saying so?
  • Is it possible that you are maybe destroying the very gameObject housing the script that is doing the loading?
  • @vintar do you mean destroying the gameObject before or after the reload? It doesn't seem like that's the case at all, because:

    1. Starting the game scene (scene 1) in Editor causes no problems.
    2A. Then, invoking Application.LoadLevel crashes it.
    2B. If I went to the title scene first (scene 0) and then load scene 1 again (with the same Application.LoadLevel) the game crashes.
    2C. Invoking an Application.LoadLevel(1) from scene 1 also crashes it.

    Does that make sense?
  • edited
    @Tuism,

    What exactly do you mean crash? As in kills itself and Unity editor with it, or hangs forever?

    If you don't call DontDestroyOnLoad, then a LoadLevel should be clean. Here re a few things to try:

    Add an empty scene to your build, and load that instead, see if it still crashes. (With empty I really mean empty).

    If the above succeeds, then try loading one empty scene from another empty scene (with just the single load script attached).

    Try loading scenes using their names instead of integers. (In the past, Unity had a bug with this, but it only manifested itself in builds... but worth eliminating).

    If all the above fail, then there may be a bug in Unity (try doing the above from a clean project). Otherwise:

    Carefully look at the code that invokes the level load - all the way from the event that causes it. (Such as the input event, or logic). Then make sure there is no way that there can be some infinite load loop, or a state that causes perpetual loading.

    Also, a few questions:

    Do load / read files from disk?

    Do you communicate over the web using WWW?

    Do you have any code that runs on start up of your scene? Temporarily deactivate and see what happens. (If you have Awake and Start methods on multiple objects of your own, do it for all of them, if it then works, you can activate them one by one to see where the problem lies).

    These things should narrow the problem down a bit.
  • edited
    It should produce a log of some sort. Forget where they are kept, maybe in "your_game_name"_Data folder.
  • FINALLY!!!

    So here's where the problem was - it turns out you HAVE TO clear generic lists, or else they seem to carry over their contents between LoadLevels. Or at least when I specifically used Clear() on all my lists it stopped crashing. Hmmm.

    Thanks guys :D
  • @Tuism: Where those lists static?
  • edited
    Ah, one of the lists were static, I didn't know that static also meant persistent. NOW I DO. Thanks!!! :D

    Wait, does that mean all static variables (members?) are also persistent between scenes and MUST be re-initialised?
  • Tuism said:
    Wait, does that mean all static variables (members?) are also persistent between scenes and MUST be re-initialised?
    Marking something as static means it belongs to the type itself, not to any particular instance of the type. Everything in static memory exists independent of the scene (or anything else really) and will continue to exist until the program stops running.
  • @Tuism, could you (for the benefit of others), still tell us what type of crash you had, and how you debugged the problem? (It's always handy to remember other people's problems for when you land in a similar situation).

  • edited
    Sure thing @hermantulleken :)

    I was using Application.Load() to load the level as a restart. First time running the level, it would be all good. Then whenever I invoked the Application.Load(), whether with integers or string, it would hang. It hung in the Unity editor, it hung in a standalone build, it just hung. No recourse but to force quit and load the program over.

    The debugging I did was taken from your advice - I commented out the entire Start() section, it crashed the game, but it could be restarted. Then I uncommented the Start() section bit by bit, eventually when I uncommented a line that was dealing with a Generic List - which I later realised was static, the hanging resumed.

    I initialised all my lists by the .Clear() method and the restarting level thing worked as advertised.

    So - static members must be re-initialised. This one's tricky because I use static for global access, without realising it would be persistent as well.
  • edited
    @Tuism, Cool, thanks!
    Tuism said:

    So - static members must be re-initialised. This one's tricky because I use static for global access, without realising it would be persistent as well.
    One alternative to statics is to have an object that contains the values you want accessible, and either have references to this object everywhere, or have a single instance of it statically available. (You can also break this object down into several classes to keep related things together.) These classes are often the manager-type classes you will see in game code. (AudioManager, GUIManager, GameManager, etc.) The classes can then provide services to the rest of the game, for example, the GUIManager can show a message, reducing the need for the rest of the game to access a global dialog.

    These manager-type classes can be implemented as a singleton, which provides a generic and convenient way to maintain this object. Grids and our free Extension package has a Singleton class that you can check out. For example, here is how you could define a GUIManager singleton:

    public class GUIManager : Singleton<GUIManager>
    {
       public MessageDialog messageDialog;
    
       public static ShowMessage(string message)
       { 
          Instance.messageDialog.ShowMessage(message);
       }
    }


    You drop this onto an empty GameObject in your scene, and can then access it from anywhere using GUIManager.Instance. You can also use the static methods from anywhere, and access its fields like this: GUIManager.Instance.messageDialog.

    Using this will give you much more control over the lifetime and state of your instances. This is a useful pattern for all games, so it is definitely worth spending some time trying to understand it.
    Thanked by 2Tuism Elyaradine
  • Thanks! I typically start with that kind of intentions, and then as I go I realise this needs to be accessed by something else and then that and then this and that... And before I knew it my gamecontroller's variables are half static half public half... etc.

    I need to do better housekeeping in general :P
    Thanked by 1Kobusvdwalt9
  • edited
    Hi Guys, I'm having a bit of trouble with something I thought was going to be a lot easier for my comp F entry. I have an enemy unit that has 4 animations for walking up, down, left and right. I compare the enemy unit's transform position in relation with the player's transform position and then change the bool that controls the animation to play the correct one. This works fine while the character is moving...until the enemy is in line with the character (on the x-axis or the y-axis). Then the animation becomes very jittery as if it is jumping between 2 of the bools e.g. plays Up animation then left animation repeatedly. I know it is something silly that I am doing wrong, but can't seem to wrap my head around the logic. Can anyone look at my code and try and see where I am going wrong. I have tried different combinations of <, >, <= and >= but can't figure out where I am going wrong. It seems that it happens because my character's position and the enemy's are only out by a couple of decimal places when they are in a straight line e.g. Player.transform.position.x = 1.005 and Enemy.transfer.position.x = 1.006. Please HELP!!!!



    private Animator anim;
    	private GameObject target;
    
    	// Use this for initialization
    	void Start () 
    	{
    		anim = GetComponent<Animator>();
    		target = GameObject.FindGameObjectWithTag("Player");
    	}
    	
    	void Update()
    	{
    		if(target != null)
    		{
    			if((transform.position.y >= target.transform.position.y) && (transform.position.x > target.transform.position.x))
    			{
    				anim.SetBool("WalkUp",false);
    				anim.SetBool("WalkDown",true);
    				anim.SetBool("WalkLeft",false);
    				anim.SetBool("WalkRight",false);
    			}
    			if((transform.position.y <= target.transform.position.y) && (transform.position.x < target.transform.position.x))
    			{
    				anim.SetBool("WalkUp",true);
    				anim.SetBool("WalkDown",false);
    				anim.SetBool("WalkLeft",false);
    				anim.SetBool("WalkRight",false);
    			}
    			
    			if((transform.position.y > target.transform.position.y) && (transform.position.x <= target.transform.position.x))
    			{
    				anim.SetBool("WalkUp",false);
    				anim.SetBool("WalkDown",false);
    				anim.SetBool("WalkLeft",false);
    				anim.SetBool("WalkRight",true);
    			}
    			if((transform.position.y < target.transform.position.y) && (transform.position.x >= target.transform.position.x))
    			{
    				anim.SetBool("WalkUp",false);
    				anim.SetBool("WalkDown",false);
    				anim.SetBool("WalkLeft",true);
    				anim.SetBool("WalkRight",false);
    			}
  • Maybe change all conditions to "else if" so there's less chance of two firing together which is what it seems is happening, but the code looks fine unless I'm missing the obvious too :P
  • vintar said:
    Maybe change all conditions to "else if" so there's less chance of two firing together which is what it seems is happening, but the code looks fine unless I'm missing the obvious too :P
    Changing it to "else if" won't really fix the problem because those conditions wont be valid at the same time but is definitely better way to code and save some process time.

    I think the problem is that once the Y position gets so close to 0 it jumps between -0.1 and 0.1 for instance thus switching ti the whole time. One solution you could use is that if the value is between -0.1 and 0.1 then it defaults to facing left for instance.
  • @Zaphire could you give me a code example of what you mean. Sorry I'm still a bit of a noob when it comes to coding. How would my if statement look to check if the Y is between -0.1 and 0.1.

    @vintar thanks for the suggestion, I had it as else statements at first, but Zaphire was right that it still jumped between the 2 states, so I tried giving each animation its own if statement...to no avail, which led to me asking for help here.
  • can you try this and see if it helps (untested) :

    private Animator anim;
    	private GameObject target;
    	private string direction = "WalkLeft";
    	private string[] directions = {"WalkUp", "WalkDown", "WalkLeft", "WalkRight"};
    	// Use this for initialization
    	void Start () 
    	{
    		anim = GetComponent<Animator>();
    		target = GameObject.FindGameObjectWithTag("Player");
    	}
    	
    	void Update()
    	{
    		if(target != null)
    		{
    			if((transform.position.y >= target.transform.position.y) && (transform.position.x > target.transform.position.x))
    			{
    				direction = "WalkDown";
    			}
    			if((transform.position.y <= target.transform.position.y) && (transform.position.x < target.transform.position.x))
    			{
    				direction = "WalkUp";
    			}
    			
    			if((transform.position.y > target.transform.position.y) && (transform.position.x <= target.transform.position.x))
    			{
    				direction = "WalkRight";
    			}
    			if((transform.position.y < target.transform.position.y) && (transform.position.x >= target.transform.position.x))
    			{
    				direction = "WalkLeft";
    			}
    		}
    	}
    	
    	void LateUpdate()
    	{
    		anim.SetBool(direction, true);
    		foreach(string s in directions)
    		{
    			if(s != direction)
    			{
    				anim.SetBool(s, false);
    			}
    		}
    	}
  • edited
    @vintar - Thanks for helping again. Tried that, but does exactly the same as in my script. Works fine if the player keeps moving, but as soon as he is stationary and the x or y axis match up it jumps between the two states. Wondering if it is not about how I move the enemy unit. This is my movement code:

    if(transform.position.y > target.transform.position.y) 
    			{
    				transform.Translate(Vector3.down * speed * Time.deltaTime);
    			}
    			else
    			{
    				transform.Translate(Vector3.up * speed * Time.deltaTime);
    			}
    			
    			if(transform.position.x < target.transform.position.x)
    			{
    				transform.Translate(Vector3.right * speed * Time.deltaTime);
    			}
    			else
    			{
    				transform.Translate(Vector3.left * speed * Time.deltaTime);
    			}
  • I'm not sure what exactly you want (I didn't see a gameplay/video link anywhere, so I can only guess).

    But my guess is that what you're looking for is more something that changes the animation based on narrower cone angles, instead of quadrants. I'd post a sample or at least a diagram, but I'm utterly exhausted...
  • edited
    @Elyaradine thanks, I got it sorted. It did have to do with how I was moving the enemy unit. I took out the Translate I was using and used a simple vector to move the enemy and it sorted the problem out. Below is my code which is now working. Have to be honest that I am still not sure why the Translate did what it did? So when you are feeling up to that diagram I would really appreciate it. But at least I got it working the way I wanted to. Thanks everyone for the help. Also, Elyaradine please post some pics of your time at GDC, I am so jealous of you guys. Enjoy the rest of your trip :)

    using UnityEngine;
    using System.Collections;
    
    public class MarauderController : MonoBehaviour {
    
    	public float speed = 1.0f;
    	private Animator anim;
    	private GameObject target;
    
    
    
    	// Use this for initialization
    	void Start () 
    	{
    		anim = GetComponent<Animator>();
    		target = GameObject.FindGameObjectWithTag("Player");
    	}
    	
    	void Update()
    	{
    		Vector3 playerPosition = (target.transform.position - transform.position).normalized;
    		transform.position += playerPosition * speed * Time.deltaTime;
    
    		if(target != null)
    		{
    				if(target != null)
    				{
    					if((transform.position.y >= target.transform.position.y) && (transform.position.x > target.transform.position.x))
    					{
    						anim.SetBool("WalkUp",false);
    						anim.SetBool("WalkDown",true);
    						anim.SetBool("WalkLeft",false);
    						anim.SetBool("WalkRight",false);
    					}
    					else if((transform.position.y <= target.transform.position.y) && (transform.position.x < target.transform.position.x))
    					{
    						anim.SetBool("WalkUp",true);
    						anim.SetBool("WalkDown",false);
    						anim.SetBool("WalkLeft",false);
    						anim.SetBool("WalkRight",false);
    					}
    					
    					else if((transform.position.y > target.transform.position.y) && (transform.position.x <= target.transform.position.x))
    					{
    						anim.SetBool("WalkUp",false);
    						anim.SetBool("WalkDown",false);
    						anim.SetBool("WalkLeft",false);
    						anim.SetBool("WalkRight",true);
    					}
    					else if((transform.position.y < target.transform.position.y) && (transform.position.x >= target.transform.position.x))
    					{
    						anim.SetBool("WalkUp",false);
    						anim.SetBool("WalkDown",false);
    						anim.SetBool("WalkLeft",true);
    						anim.SetBool("WalkRight",false);
    
    					}
    
    				}
  • Hey peeps

    I've switched to unity 5 and i was wondering if anyone else has? all my feedback regarding unity 5 is awesome, here and there I've had to figure out how to implement something in a different way because of the new physics 3.3 engine, other than that its pretty awesome.

    my question is about skyboxes.
    in unity 4 you could import 4 or 5 skyboxes that were part of the standard packages but now the option to import skyboxes is not there (i don't want to use the word missing, but they are missing, lol)

    can anyone point me into the right direction?
  • Hey peeps

    I've switched to unity 5 and i was wondering if anyone else has? all my feedback regarding unity 5 is awesome, here and there I've had to figure out how to implement something in a different way because of the new physics 3.3 engine, other than that its pretty awesome.

    my question is about skyboxes.
    in unity 4 you could import 4 or 5 skyboxes that were part of the standard packages but now the option to import skyboxes is not there (i don't want to use the word missing, but they are missing, lol)

    can anyone point me into the right direction?
    Noticed this too, as well as the edit/render settings being amiss too. I just copied the skyboxes from an old project :)

  • edited
    Skyboxes aren't missing, just re-vamped and made more awesome.
    Create > Material
    Change shader type to: Skybox > Procedural
    Window > Lighting > drag your newly created skybox material into the skybox field.

    http://docs.unity3d.com/Manual/HOWTO-UseSkybox.html
    Thanked by 2FanieG vintar
  • Hi guys,

    I'm having size issues when building for Android.
    Whats the best way to export 2D sprites from photoshop? Is there some sort of trick to it?

    The PNGs come out at about 137kb, but once imported into Unity, they bounce up to 1.3mb.
    I've tried compressing them, but I end up with a lot of banding.
Sign In or Register to comment.