• Unity3D - Discussion
    5,004 replies, posted
[QUOTE=chaz13;44033836]Anyone got any tips on texturing? It seems like black magic and has really put me off using unity because I can't texture any models.[/QUOTE] Whats the problem? It's pretty simple. Make a UV map, then a texture. Export the model, setup the material and assign it. Where does it go wrong?
I guess I don't get the process of going from the UV map you export to making the texture, like literally knowing what part of the UV map is corresponds to what poly on the model and getting it all to blend/look right.
It depends on your 3d package of choice. In general, you unwrap the mesh to a 2d plane (by NOT using autounwrap), export the uv map as image, draw your texture over it and use that image as texture. Setting up a material in unity is the same as usual, pick shader, assign texture. This is a pretty good tutorial (only skimmed over it, so if it's not, don't sue me :p): [url]http://cgcookie.com/blender/2011/01/21/intro_uvmapping/[/url] I'm just posting one for blender here since you can get that the quickest, but in general, google for "<3d package name> uv unwrapping tutorial" and you'll find some stuff. If i'm not clear, say what part of the process you don't get and i'll try to elaborate.
After a few hours of hitting my head against my keyboard, I've made a short video about some of the things that I've done with my game. Bear in mind that the whole thing is tied together with bits of twine and chewing gum at the moment since I haven't got half of the necessary things in, or I have but they need attaching to items/the environment. [video=youtube;QUUuXoesFPs]http://www.youtube.com/watch?v=QUUuXoesFPs&feature=c4-overview&list=UUlSdAOcN_dStix9yQkKXmsQ[/video] I've posted what it's about before, but since that was a way ago I'll just say that you're on an island in space and will crash into the moon in 100 days, you go to parallel universes to steal their supplies and rescue people to help you, and you can extend the island and build them somewhere to live/research items and stuff for BOSS FIGHTS and things. There's a big difference in a lot of the art because a lot of in-dev stuff I made where as the other things were made by a competent artist that can actually draw, and is currently putting that to use making real games for proper people.
The game I'm working on is nearly done for playtesting (Local only!) Can't wait to polish this sucker up for E3!
Would be nice if I could create a texture from just a byte array that's DXT compressed. Unity supports DXT compressed textures so I'm not sure why they don't allow that. Surely all they would have to do is expose the byte array of the texture. Seems daft to write my own DXT decompressor, feed it ARGB32 only for it to compress it back to DXT.
Been playing around with the terrain editor, after a few years of using hammer, it's really quite magical. (I've fixed the movement by the way) [IMG]https://dl.dropboxusercontent.com/u/33714868/mountainmouse.jpg[/IMG]
[QUOTE=Duskling;44033204]This is a game that I made in an hour or so yesterday. The controls are WASD to move and the mouse to look around. -snap- EDIT: I can't get the unity embed to work, here is the link [url]http://dooskington.com/data/vidja/Web.html[/url][/QUOTE] holy fuck i damn near shat myself
I don't know what is the right way to start learning and get good to something(except practicing) Could anyone give me link to tutorials/documentations or what ever you used when you started using Unity. First time I started using Unity with C# but because I couldn't find tutorials I went to JavaScript(which is now), because I think C# it's more superior to JavaScript I would like to use that but don't know how to start with it. I've got the basics but how to use them in Unity. @garry Quote from Garry "So on Sunday I printed a bunch of crap out. Pretty much anything that was a PDF I could find – that mentioned coding using c# in unity." Since you didn't know how to use Unity and you are making a really cool game(Rust) how long it took you to actually get good to it and be able to do what you want. Did you had previous experience with C#
I used to think that C# is superior but honestly at the end of the day in Unity it doesn't really matter what language you use as each has their own set of benefits and drawbacks.
Is there any bennefits/drawbacks to having many small scripts vs a couple of heavy scripts? eg having one single script that controls mouse commands vs having a script for: unit selection, unit moving/attacking...
By superior I meant more like optimization.
[QUOTE=Richy19;44043173]Is there any bennefits/drawbacks to having many small scripts vs a couple of heavy scripts? eg having one single script that controls mouse commands vs having a script for: unit selection, unit moving/attacking...[/QUOTE] As far as i know, there are more drawbacks to having 1 huge script, then having multiple smaller ones. I think it doesn't even matters on a performance level. Better to use multiple smaller ones that each do a specific thing, then 1 big mess of a master script imo. Makes it easier to manage everything
[QUOTE=BoowmanTech;44043004]I don't know what is the right way to start learning and get good to something(except practicing) Could anyone give me link to tutorials/documentations or what ever you used when you started using Unity. First time I started using Unity with C# but because I couldn't find tutorials I went to JavaScript(which is now), because I think C# it's more superior to JavaScript I would like to use that but don't know how to start with it. I've got the basics but how to use them in Unity. @garry Quote from Garry "So on Sunday I printed a bunch of crap out. Pretty much anything that was a PDF I could find – that mentioned coding using c# in unity." Since you didn't know how to use Unity and you are making a really cool game(Rust) how long it took you to actually get good to it and be able to do what you want. Did you had previous experience with C#[/QUOTE] I've found, so far, that Unity has a big enough community that if I've wanted to figure out how to do something I've been able to just google "<thing I want to do> unity" and to figure it out from there fairly easily. The Unity Docs seem decent as well, so spend some time there. Watch their official videos too. If you're comfortable with javascript it might be easier for you to just use javascript while you focus on learning Unity, and then make the switch over to C# if/when you want to do that. That way you're just learning the engine instead of the engine and a language.
Using what you are more comfortable with makes using Unity more.. comfortable and easier I suppose. I know that it would suck to learn a new language + a new tool on top of it.
[QUOTE=Richy19;44043173]Is there any bennefits/drawbacks to having many small scripts vs a couple of heavy scripts? eg having one single script that controls mouse commands vs having a script for: unit selection, unit moving/attacking...[/QUOTE] The more modular your components are, the more likely you'll be able to reuse them. There's definitely things to focus on that will have a lot bigger performance impact than having three small scripts vs one larger script. I'd keep them small because the dev time you'll save by keeping things more modular can be spent on optimization if you do end up finding big performance problems with using multiple scripts. [editline]25th February 2014[/editline] [QUOTE=Johnny Guitar;44043581]Using what you are more comfortable with makes using Unity more.. comfortable and easier I suppose. I know that it would suck to learn a new language + a new tool on top of it.[/QUOTE] I'm learning C# at the same time as Unity right now and it's definitely harder haha. Spent 45 minutes yesterday trying to figure out why something wasn't working and it came down to C# inheritance not behaving in a way that I'm used to Ruby behaving :(
Once you figure out once you did wrong, you aren't bound to make the same mistake again is how I typically look at it.
Early days but I've started to read VTF files in. DXT1, DXT3, DXT5 are decompressed to ARGB32, I also use the mipmaps from the file if they're there, otherwise I just let Unity calculate them. I need to make VMT and VPK readers after this so I can just point to a steamapps directory and load everything from there. [img]https://dl.dropboxusercontent.com/u/99765/0234217.png[/img]
[QUOTE=KmartSqrl;44043551]I've found, so far, that Unity has a big enough community that if I've wanted to figure out how to do something I've been able to just google "<thing I want to do> unity" and to figure it out from there fairly easily. The Unity Docs seem decent as well, so spend some time there. Watch their official videos too. If you're comfortable with javascript it might be easier for you to just use javascript while you focus on learning Unity, and then make the switch over to C# if/when you want to do that. That way you're just learning the engine instead of the engine and a language.[/QUOTE] [QUOTE=Johnny Guitar;44043581]Using what you are more comfortable with makes using Unity more.. comfortable and easier I suppose. I know that it would suck to learn a new language + a new tool on top of it.[/QUOTE] Honestly I can't say I am comfortable with neither one of them since I don't know the language so well. I knew the basics for C# from when I was coding in GLua(mostly client side). Now I started going through JavaScript tutorials and I watched them quickly because they are very similar. What do you mean by learning the Engine ?
[QUOTE=BoowmanTech;44043233]By superior I meant more like optimization.[/QUOTE] I don't think there would be much of a difference (but I haven't tested it and know nothing about it in context to Unity). One of them might be able to make a few more calls static, but dictionary lookups are so fast they might as well be free. The difference in programming effort is usually far more important, and that also depends on who is working on it. For example, I can't work well with dynamic languages because they fail more slowly. I get stuff done much easier if the framework is relatively rigid and fails hard - and ideally even before hitting compile. [editline]25th February 2014[/editline] A bit like preferring Lego over putty even though you can make most shapes (especially round ones) much faster with the latter I suppose... Though that comparison is cheating a bit because Lego is really awesome :v:
What makes a language dynamic and can you provide a few examples?
[QUOTE=BoowmanTech;44044549]What do you mean by learning the Engine?[/QUOTE] I mean learning how Unity and the functionality it provides works.
[QUOTE=Johnny Guitar;44045105]What makes a language dynamic and can you provide a few examples?[/QUOTE] I suppose not having actual classes, like in JS and I [I]think[/I] Python where you can just add methods and members on objects at runtime and it fails ([URL="https://www.destroyallsoftware.com/talks/wat"]or returns weird stuff[/URL]) with a runtime error if one is not there or has the wrong type. The opposite are languages like F# and to a lesser extent C# and C(++) which do lots of verification in the compiler or earlier and therefore catch many typo-like errors immediately, even if the code never runs. [editline]26th February 2014[/editline] The extreme of dynamic languages is maybe Lisp, which allows some thing that are [URL="http://random-state.net/features-of-common-lisp.html"]weird[/URL], to say the least. (I'm a bit biased against this kind of stuff though. It probably has its uses somewhere but I prefer my programs to crash early and not have weird crosstalk between components.)
[QUOTE=Tamschi;44047673]I suppose not having actual classes, like in JS and I [I]think[/I] Python where you can just add methods and members on objects at runtime and it fails ([URL="https://www.destroyallsoftware.com/talks/wat"]or returns weird stuff[/URL]) with a runtime error if one is not there or has the wrong type. The opposite are languages like F# and to a lesser extent C# and C(++) which do lots of verification in the compiler or earlier and therefore catch many typo-like errors immediately, even if the code never runs. [editline]26th February 2014[/editline] The extreme of dynamic languages is maybe Lisp, which allows some thing that are [URL="http://random-state.net/features-of-common-lisp.html"]weird[/URL], to say the least. (I'm a bit biased against this kind of stuff though. It probably has its uses somewhere but I prefer my programs to crash early and not have weird crosstalk between components.)[/QUOTE] "actual classes" doesn't really have anything to do with it. Tons of dynamic languages have full OOP implementations. A Ruby class is a class just as much as a Java class is. The super super short and sweet version of the difference is that in dynamically typed languages, you can assign a value of any type to any variable. In a statically typed language, if something is supposed to be an integer you declare that and you can only make it an integer.
-snip-
Correct me if I'm wrong but I think what you have to do is (im going to assume you're using VS and c#) go to Assets > Sync Monodevelop Project then find your project folder and open the file named [project_name]-csharp.sln with VS [IMG]https://dl.dropboxusercontent.com/u/13781308/ShareX/2014-02/2014-02-25_21-02-37.png[/IMG] [editline]ed[/editline] oh, you snipped your post
[QUOTE=Pelf;44049093]Correct me if I'm wrong but I think what you have to do is (im going to assume you're using VS and c#) go to Assets > Sync Monodevelop Project then find your project folder and open the file named [project_name]-csharp.sln with VS [IMG]https://dl.dropboxusercontent.com/u/13781308/ShareX/2014-02/2014-02-25_21-02-37.png[/IMG] [editline]ed[/editline] oh, you snipped your post[/QUOTE] I created a variable in which I used Input.GetAxis and it didn't show up but when I didn't used it as a variable it worked. I will try that. [editline]26th February 2014[/editline] And now I am using JavaScript. [editline]26th February 2014[/editline] So I've created a sphere and I assigned a player controller to it. How would I make it go faster because right now it is really slow. I tried to change the speed but nothing happened and my ball size is 0.4 [code] var speed : int = 1000; // Speed Power var jump : float = 4; // Jump power private var isFalling = false; function Update () { //Change the player position using A - D var rotation : int = Input.GetAxis("Horizontal") * speed ; rotation *= Time.deltaTime; rigidbody.AddRelativeTorque(Vector3.back * rotation); if(Input.GetKeyDown(KeyCode.W) && isFalling == false) { rigidbody.velocity.y = jump; } isFalling = true; } function OnCollisionStay() { isFalling = false; } [/code]
[code]var rotation : int = Input.GetAxis("Horizontal") * speed ; rotation *= Time.deltaTime;[/code] You are using int for your rotation (spinSpeed?), when float is more applicable here. Torque is limited by maxAngularVelocity. The default maxAngularVelocity for all rigidbodies is 7, and can be changed (globally) via Project Settings > Physics. To change maxAngularVelocity per rigidbody, use rigidbody.maxAngularVelocity = ? in your script. For a rolling ball game, use AddForce instead of AddTorque. Its easier for the player to control/change direction. Unity's [url=http://unity3d.com/learn/tutorials/projects/roll-a-ball]ball game[/url] tutorial uses AddForce. You are also applying force over several frames. You should use FixedUpdate() instead of Update(). For jumping, its OK to put it in Update().
Any suggestions on code optimization? This block of code took about 22 seconds to complete... [CODE]void GeneratePlanes() { GameObject Floor = new GameObject("Floor"); Mesh FloorMesh = new Mesh(); Floor.AddComponent("MeshFilter"); Floor.AddComponent("MeshRenderer"); Floor.AddComponent("MeshCollider"); Floor.renderer.material = FloorMaterial; List<Vector3> VertexList = new List<Vector3>(); List<Vector2> UVList = new List<Vector2>(); List<int> TriList = new List<int>(); int CurrentCell = 0; for (int i=0; i<MapX; i++) { for (int j=0; j<MapY; j++) { if (DrawBorders) { if ((i == 0 || i == MapX - 1) || (j == 0 || j == MapY - 1)) { GameObject plane = GameObject.CreatePrimitive(PrimitiveType.Plane); plane.transform.position = new Vector3(i * PlaneSize, 0, j * PlaneSize); plane.transform.localScale = new Vector3(PlaneSize / 10, 1, PlaneSize / 10); } } if (Map[i, j]) { float CellX = (i - 0.5f) * PlaneSize; float CellY = (j - 0.5f) * PlaneSize; VertexList.Add(new Vector3(CellX, 0, CellY)); VertexList.Add(new Vector3(CellX + PlaneSize, 0, CellY)); VertexList.Add(new Vector3(CellX, 0, CellY + PlaneSize)); VertexList.Add(new Vector3(CellX + PlaneSize, 0, CellY + PlaneSize)); UVList.Add(new Vector2(0f, 0f)); UVList.Add(new Vector2(1f, 0f)); UVList.Add(new Vector2(0f, 1f)); UVList.Add(new Vector2(1f, 1f)); TriList.Add(0 + (4 * CurrentCell)); TriList.Add(3 + (4 * CurrentCell)); TriList.Add(1 + (4 * CurrentCell)); TriList.Add(0 + (4 * CurrentCell)); TriList.Add(2 + (4 * CurrentCell)); TriList.Add(3 + (4 * CurrentCell)); Vector3[] vertices = new Vector3[VertexList.Count]; for (int x=0; x<vertices.Length; x++) { vertices[x] = (Vector3)VertexList[x]; } Vector2[] uv = new Vector2[UVList.Count]; for (int x=0; x<uv.Length; x++) { uv[x] = (Vector2)UVList[x]; } int[] triangles = new int[TriList.Count]; for (int x=0; x<triangles.Length; x++) { triangles[x] = (int)TriList[x]; } FloorMesh.vertices = vertices; FloorMesh.uv = uv; FloorMesh.triangles = triangles; FloorMesh.RecalculateNormals(); Floor.GetComponent<MeshFilter>().mesh = FloorMesh; Floor.GetComponent<MeshCollider>().sharedMesh = Floor.GetComponent<MeshFilter>().mesh; CurrentCell++; } } } }[/CODE] [editline]25th February 2014[/editline] To be more clear, this was with a 500x500 grid array. For each one of those points on the grid it took about 0.15 seconds to generate the triangles for the overall mesh. Granted that by itself is small, but when you get a grid with mostly filled cells, it takes a while.
So I did that but now the ball starts slowly then it reaches the speed and when I jump it's link a super jump. It's like it throws me away.
Sorry, you need to Log In to post a reply to this thread.