For those using models, how do you go about it? I've literally never made a model or 3D mesh ever for any engine, so I'm literally brain dead on the subject.
[url=http://unity3d.com/unity/workflow/asset-workflow]This page[/url] shows the supported formats for Unity.
Just import it into your project and it should automatically create its own material files. For animations you might need to do a bit of work, e.g. setting animation clips.
You can change several settings on imported models like its scale, whether to use provided normals or recalculate, and some other stuff.
Drag the imported model (from your project files) into the scene. It'll automatically add the model (and its skeleton, if provided). To use animations you need to write scripts that interact with Animation (Legacy, prior to Unity 4) or Animator (Mecanim, Unity 4+)
This is a tutorial for Mecanim, the new animation system for Unity 4+. Note that Curve Editor is not available for Unity Free.
[media]http://www.youtube.com/watch?v=Xx21y9eJq1U[/media]
-snopfixeditimanidiot-
link to said video?
[QUOTE=Silentfood;40665833]For those using models, how do you go about it? I've literally never made a model or 3D mesh ever for any engine, so I'm literally brain dead on the subject.[/QUOTE]
Importing models in unity is extremely easy and simple to do. Just drag and drop the file into unity and tweak your settings ( if you want )
Modelling is an entire other topic. Unity offers support for a wide range of formats so you can pick whichever you want. Most 3d applications support the most popular format .fbx. I would very much suggest learning the basics of Blender if you plan on making art for games. It is a very popular free modelling and animation tool and the pipeline between blender and unity is very easy. Check out these links:
[url]http://www.blender.org/[/url]
[url]http://blendtuts.com/blender_tutorials?field_level_value=Beginner[/url] <- for learning the basics of blender
[url]http://docs.unity3d.com/Documentation/Manual/ImportingAssets.html[/url] <- basics of unitys asset importing.
Unity can even import .blend files which makes getting models into unity from blender even easier.
[QUOTE=Pelf;40667950]Unity can even import .blend files which makes getting models into unity from blender even easier.[/QUOTE]
Indeed.
I never use blend files in unity though because it ends up having a bunch of .blend1, .blend2, .blend3 files etc. It's just cleaner to import .fbx files. Also, Some people have had issues with importing animations as .blend files but that may have been fixed.
Vehicle combat game I'm making.
[THUMB]http://i.imgur.com/xQ5Z0iz.jpg[/THUMB]
[THUMB]http://i.imgur.com/lyMmiwv.jpg[/THUMB]
Sweet, thanks!
I bought the 2D Toolkit, it's pretty cool.
[unity]https://dl.dropboxusercontent.com/u/41313766/Public.unity3d[/unity]
Guys I need help with making a functioning file reader that's compact and able to determine from a massive amount of possibilities what the next imput line is. Before I made a streamwriter/reader system that would write an array in segments to a text file and read them back, determining when a section was done by using a "#nameend" for example. It worked well because I only had about five options. Now I'm making a system for a new shooter idea that would procedurally generate and read weapons. Problem is now my streamreader is faced with about three dozen options of what the next line's data might contain. Is there a compact way to deal with this without a three-dozen-long case statement and enum variable?
[QUOTE=Trekintosh;40677739]Guys I need help with making a functioning file reader that's compact and able to determine from a massive amount of possibilities what the next imput line is. Before I made a streamwriter/reader system that would write an array in segments to a text file and read them back, determining when a section was done by using a "#nameend" for example. It worked well because I only had about five options. Now I'm making a system for a new shooter idea that would procedurally generate and read weapons. Problem is now my streamreader is faced with about three dozen options of what the next line's data might contain. Is there a compact way to deal with this without a three-dozen-long case statement and enum variable?[/QUOTE]
Can you seek backwards once you find invalid data for the current array?
[QUOTE=Tamschi;40677791]Can you seek backwards once you find invalid data for the current array?[/QUOTE]
What do you mean exactly? I'm relatively new to streamreading/writing, but in this case it won't be reading to an array, just individual variables.
-edit-
Here's the current list of variables that it will be loading from the text file to see an idea of what I'm working with.
[CODE]//gun prefab vars
var shellcasing : GameObject;
var magazine : GameObject;
var hitSparks : GameObject;
var primaryProjectile : GameObject;
var secondaryProjectile : GameObject;
//gun position vars
var magDropPoint : GameObject;
var shellEjectionPointL : GameObject;
var muzzle : GameObject; //THIS MUST ALSO BE THE PARTICLE EMITTER FOR THE MUZZLE FLASH!
//only for double barrel weapons/alternate fire weapons
var muzzle2 : GameObject;
var shellEjectionPointR : GameObject;
//audio variables
var sound_Fire1 : AudioClip;
var sound_Fire2 : AudioClip; //only for double barreled/alternate fire equipped weapons
var sound_Click : AudioClip;
var sound_Click2 : AudioClip; //only for weapons with fire selectors
var sound_Cock : AudioClip; //racking the slide or pumping a shotgun or pushing the on button/whatever
//stat vars
var name : String;
var primaryTags : String;
var numBulletsPrimary : int;
var primaryDamage : float;
var primaryProjectileSpeed : float;
var primaryReloadTime : float;
var primaryClip : int;
var primaryAccuracy : float;
var primaryAmmoType : String;
//only for secondary fires
var hasSecondary : boolean = false;
var secondaryTags : String;
var numBulletsSecondary : int;
var secondaryDamage : float;
var secondaryReloadTime : float;
var secondaryClip : int;
var secondaryAmmoType : String;
var secondaryAccuracy : float;[/CODE]
They could be in any possible order in the text file in the format
#tagname
value
#nexttag
value
unless there is a better way to format, which I am very happy to use.
[QUOTE=Trekintosh;40677808]What do you mean exactly? I'm relatively new to streamreading/writing, but in this case it won't be reading to an array, just individual variables.[/QUOTE]
Before you read a line store the stream position, then when the next line isn't part of the array seek back to the start of the line and continue with the outer loop. It's not 100% efficient but it should work.
[QUOTE=Tamschi;40677829]Before you read a line store the stream position, then when the next line isn't part of the array seek back to the start of the line and continue with the outer loop. It's not 100% efficient but it should work.[/QUOTE]
The problem I'm having is an efficient way to figure out what section I'm currently in. I don't want to do 39 if/case statements. Is there any way to avoid that? Maybe use the exact variable name as the tag? That would work well if there was a way to do, for example in psuedocode:
[CODE]previnput = sReader.ReadLine;[/CODE]
where the previnput is the tag I just read that is also the variable name. For example I read the line #numBulletsPrimary and save it to input, then I use that as the name of my variable in the code. Is there a way to do that?
Okay, I've got it so I can call my variable using reflections. Here's my code as it stands:
[CODE]while(true){
input=sReader.ReadLine();
if(input.Contains("#"){
var tempscript=this.GetType();
var tempvar=tempscript.GetField(input.Substring(1,input.Length-1));
print(tempvar)
var tempinput=sReader.ReadLine();
print(tempinput);
tempvar.SetValue(tempscript,tempinput);
}
Else if(input==null){break;}
[/CODE]
Now the problem is twofold. One, while I have strings as the first set of variables in the text file its reading, it's not writing them to their variables. The print statements are confirming the variables are correct, as are the values, but the inspector is showing no change. Secondly how so I parse the strings for non-string variables it writes to? Getting the type of the tempvar just returns that its a reflection variable, which doesn't help at all.
Also FUCKING NEVER TYPE CODE ON AN IPHONE HOLY FUCK!!!
Does anyone know how to add force to an object relative to the direction its facing?
i'm new to this, and i can't figure it out.
[QUOTE=ZnT00;40680514]Does anyone know how to add force to an object relative to the direction its facing?
i'm new to this, and i can't figure it out.[/QUOTE]
[url]http://docs.unity3d.com/Documentation/ScriptReference/ConstantForce-relativeForce.html[/url]
or
[url]http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.AddRelativeForce.html[/url]
We just won dare to be digital nordic with our unity prototype/idea and we're going to scotland this summer to develop it.
Garry you should come to protoplay in august and hire me.
[QUOTE=Trekintosh;40679442]Okay, I've got it so I can call my variable using reflections. Here's my code as it stands:
[CODE]while(true){
input=sReader.ReadLine();
if(input.Contains("#"){
var tempscript=this.GetType();
var tempvar=tempscript.GetField(input.Substring(1,input.Length-1));
print(tempvar)
var tempinput=sReader.ReadLine();
print(tempinput);
tempvar.SetValue(tempscript,tempinput);
}
Else if(input==null){break;}
[/CODE]
Now the problem is twofold. One, while I have strings as the first set of variables in the text file its reading, it's not writing them to their variables. The print statements are confirming the variables are correct, as are the values, but the inspector is showing no change. Secondly how so I parse the strings for non-string variables it writes to? Getting the type of the tempvar just returns that its a reflection variable, which doesn't help at all.
Also FUCKING NEVER TYPE CODE ON AN IPHONE HOLY FUCK!!![/QUOTE]
GetType() returns the type of the FieldInfo (?) instance you currently have, the type of the field should be in FieldType. Once you have that you will need an if-else-chain to parse it.
[img]http://i.imgur.com/lfS0EaP.png[/img]
[i]What?[/i]
No matter what i put in, it says "Expecting EOF, Recieved *Whatever is before the next line"
i'm trying to learn how to use unity, but this keeps happening, and i have no idea what to do.
[QUOTE=ZnT00;40689898][img]http://i.imgur.com/lfS0EaP.png[/img]
[i]What?[/i]
No matter what i put in, it says "Expecting EOF, Recieved *Whatever is before the next line"
i'm trying to learn how to use unity, but this keeps happening, and i have no idea what to do.[/QUOTE]
Can you post your code?
[QUOTE=Asgard;40690006]Can you post your code?[/QUOTE]
[code]var thrustmain : ParticleEmitter;
var thrustturnleft : ParticleEmitter;
var thrustturnright : ParticleEmitter;
var thrustdown : ParticleEmitter;
var ForceAmount : int;
var shipExplosions : GameObject[];
var relativeForce :Vector3;
var sparks : ParticleEmitter;
function Start ()
{
}
function Update ()
{
if(Input.GetAxis("Horizontal") > 0)
{
thrustturnright.emit = true;
thrustturnleft.emit = false;
rigidbody.AddTorque(0,0,2);
}
if(Input.GetAxis("Horizontal") < 0)
{
thrustturnleft.emit = true;
thrustturnright.emit = false;
rigidbody.AddTorque(0,0,-2);
}
if(Input.GetAxis("Horizontal") == 0)
{
thrustturnleft.emit = false;
thrustturnright.emit = false;
}
if(Input.GetAxis("Vertical") > 0)
{
thrustmain.emit = true;
thrustdown.emit = false;
rigidbody.AddRelativeForce (Vector3.forward * 10);
}
if(Input.GetAxis("Vertical") < 0)
{
thrustdown.emit = true;
thrustmain.emit = false;
rigidbody.AddRelativeForce (Vector3.forward * -10);
}
if(Input.GetAxis("Vertical") == 0)
thrustmain.emit = false;
thrustdown.emit = false;
}
function OnCollisionEnter(hitInfo : Collision)
{
if(hitInfo.relativeVelocity.magnitude >= 5);
Explode();
};
;
else if(hitInfo.gameObject.tag == "LandingPad")
{
var landingPad : LandingPad;
landingPad = hitInfo.gameObject.GetComponent("LandingPad");
landingPad.Activate();
}
function Explode()
{
var randomNumber : int;
randomNumber = Random.Range(0,shipExplosions.length);
Instantiate(shipExplosions[0], transform.position, transform.rotation);
Destroy(gameObject);
}
[/code]
the problem area is around "function OnCollisionEnter", i think, because it broke when i changed that, and when i reverted it, it didn't fix it
The fuck is that semicolon doing there?
[code]function OnCollisionEnter(hitInfo : Collision)
{
if(hitInfo.relativeVelocity.magnitude >= 5);
Explode();
}; <- and this one
; <- this one[/code]
[QUOTE=MatheusMCardoso;40690135]The fuck is that semicolon doing there?
[code]function OnCollisionEnter(hitInfo : Collision)
{
if(hitInfo.relativeVelocity.magnitude >= 5);
Explode();
}; <- and this one
; <- this one[/code][/QUOTE]
There's your problem
I may be wrong because it's javascript and i've never used it.
[QUOTE=MatheusMCardoso;40690135]The fuck is that semicolon doing there?
[code]function OnCollisionEnter(hitInfo : Collision)
{
if(hitInfo.relativeVelocity.magnitude >= 5);
Explode();
}; <- and this one
; <- this one[/code][/QUOTE]
I was just trying to make it work, and it doesn't work if i remove them either
Well, they shouldn't be there. Other than that i can't speak much for javascript.
Been messing more with the beast lightmapping included in unity, this is a tram station that is going to be connected to some skyscraper. Any feedback?
[IMG]http://i.imgur.com/4AbkqtD.png[/IMG]
[IMG]http://i.imgur.com/dSESAQe.png[/IMG]
Sorry, you need to Log In to post a reply to this thread.