[QUOTE=Asgard;44126683]I have to admit I haven't really been following this thread, so sorry if you've already posted about this before, but what do you mean with a game controller?[/QUOTE]
Mouse Look, WASD. I think I was suppose to say character controller.
I am thinking as my first 3D project to make like a Melon Racer game.
[QUOTE=BoowmanTech;44127073]Mouse Look, WASD. I think I was suppose to say character controller.
I am thinking as my first 3D project to make like a Melon Racer game.[/QUOTE]
Unity provides a standard character controller that works fine for a lot of cases.
[QUOTE=Asgard;44127092]Unity provides a standard character controller that works fine for a lot of cases.[/QUOTE]
Yeah but honestly what's the point in using it If I can't make it?
And if I have like a character with multiple animations I can't use it because it's not good.
[QUOTE=BoowmanTech;44127363]Yeah but honestly what's the point in using it If I can't make it?[/QUOTE]
To get you started and let you worry about other things for the time being :P
Also for others who doesn't know how to make one, I found this really basic one and it's working.
This way you know how to make one and understand it.
[url=http://pastebin.com/111UHFWR]Click Here !![/url]
[QUOTE=BoowmanTech;44127363]Yeah but honestly what's the point in using it If I can't make it?
And if I have like a character with multiple animations I can't use it because it's not good.[/QUOTE]
Why not make your own engine instead of using Unity? Why not reinvent the wheel?
[QUOTE=Asgard;44128167]Why not make your own engine instead of using Unity? Why not reinvent the wheel?[/QUOTE]
Don't be thick. He wants to make a character controller because the default one is lacking in many things and it's excellent programming experience.
[editline]4th March 2014[/editline]
[QUOTE=Skipcast;44111381]I'm not very good at explaining things, but i'll try.
In C#, you'd create a class and derive from it like this:
[cpp]
public class HumanBeing
{
public string Name;
public DateTime Birthday;
public int Weight;
public HumanBeing(string name, DateTime birthday)
{
Name = name;
Birthday = birthday;
Weight = 75;
}
public void Eat(int amount)
{
this.Weight += amount; // the "this" keyword isn't needed here unless for example a parameter in the method is named the same thing.
}
public virtual void Greet(HumanBeing human) // "virtual" means that the method can be overriden in a derived class.
{
Console.WriteLine(this.Name + " greets " + human.Name);
}
}
public class Bob : HumanBeing // adding " : BaseClassName" will make this class derive from the specified class.
{
public Bob() : base("Bob", new DateTime(1965, 8, 5) // adding " : base(...)" will call the base classes constructor so you won't have to write the same constructor in every derived class.
{
this.Weight = 80; // remember that we're deriving from the base class. this enables us to access the base class's members.
}
public override void Greet(HumanBeing human)
{
Console.WriteLine("Bob says hello to " + human.Name);
// You can call the base method by calling base.Greet(human); That would output: Bob greets OtherHuman. Assuming the other HumanBeing's Name variable would be "OtherHuman".
}
}
static class Entry
{
public static void Main(string[] args)
{
HumanBeing human = new HumanBeing("My name", new DateTime(1985, 5, 17)); // My name, born 17th may 1985
Console.WriteLine(human.Weight); // outputs 75
human.Eat(20);
Console.WriteLine(human.Weight); // outputs 95.
HumanBeing human2 = new HumanBeing("Second person", new DateTime(1982, 2, 12));
human2.Greet(human); // outputs: Second person greets My name
Bob bob = new Bob();
bob.Greet(human2); // outputs: Bob says hello to Second person
}
}
[/cpp]
Regarding your 2nd question, that's because the sprite variable isn't a string.
It's probably a Sprite: [url]http://docs.unity3d.com/Documentation/ScriptReference/Sprite.html[/url][/QUOTE]
I think I'm starting to understand inheritance. I'll give it a go when I fire up Unity next.
Regarding the sprite thing, I know it isn't a string variable. What I'm asking is how can I make it load it by name. Alternately, how can I load a material texture by name? Instead of using sprites, I'm happy to just use planes and textures instead.
[QUOTE=Asgard;44128167]Why not make your own engine instead of using Unity? Why not reinvent the wheel?[/QUOTE]
Thanks for being sarcastic, and I can't use the standard control, because what I want to make is a racing game.
Oh yes! I think I understand classes now! Thanks SkipCast! Now Warship Gunner 3 production can proceed full steam ahead! Seriously, between Resource.Load, which I just found out about because none of my four programming books saw fit to tell me, and Classes to ease data transfer between objects, it's [I]vastly[/I] easier to do what I'm trying to do. I hope to have a first version prototype up by the end of the week.
Does anyone know a site where I can host my unity projects for free while I'm working on them?
Secondly, since I'm now going to be using Resource.Load and its variants as basically the core function of my game in order to make it moddable from the very beginning, when I build the game, is the Resources folder going to be accessible to the end user? Or do I need to do something else in order to accomplish this?
Die rolling with board movement & random names working. building selection is still really wonky though.
Edit-> Actually just figured out whats causing the wonky selection, just have to find a workaround
[unity]https://dl.dropboxusercontent.com/u/10044881/Unity/TowersPrototype/TowersPrototype.unity3d[/unity]
[QUOTE=Huabear;44134595]Die rolling with board movement & random names working. building selection is still really wonky though.
Edit-> Actually just figured out whats causing the wonky selection, just have to find a workaround
-Cute city board game-[/QUOTE]
That works quite well. It's oddly relaxing just to roll the dice again and again. May I ask what are you using to determine what the dice have rolled? Are you tracking their angles or using some other method?
I had a go at making my own dice but it ended up being too much of a hassle. I ended up just using Dice Pack from Wyrmtale ([url]http://www.wyrmtale.com/products/unity3d-components/dicepack[/url]) of which there is also a free version available.
I did have to make some adjustments in it's code (for size and a couple other things), but the main thing is does is automatically return a value once the dice stop rolling of which I just use a Coroutine to wait for. Pretty much everything else I've coded myself, but there is some use of iTween involved.
[QUOTE=Trekintosh;44130077]Don't be thick. He wants to make a character controller because the default one is lacking in many things and it's excellent programming experience.
[editline]4th March 2014[/editline]
I think I'm starting to understand inheritance. I'll give it a go when I fire up Unity next.
Regarding the sprite thing, I know it isn't a string variable. What I'm asking is how can I make it load it by name. Alternately, how can I load a material texture by name? Instead of using sprites, I'm happy to just use planes and textures instead.[/QUOTE]
If you look at the link i posted, you'll see that Sprite has a static function called [url="http://docs.unity3d.com/Documentation/ScriptReference/Sprite.Create.html"]Create[/url].
To get the Texture2D, you can either create a public Texture2D variable and set it in the editor, or read up on how to load Texture2D from code.
[QUOTE=Skipcast;44134920]If you look at the link i posted, you'll see that Sprite has a static function called [url="http://docs.unity3d.com/Documentation/ScriptReference/Sprite.Create.html"]Create[/url].
To get the Texture2D, you can either create a public Texture2D variable and set it in the editor, or read up on how to load Texture2D from code.[/QUOTE]
Actually I already solved it by using Resource.Load to load the texture. I mentioned it in my post at the bottom of the page. It wasn't getting the sprite to cooperate with the Texture2D, it was loading it with code that was confusing me. And thanks to the link you posted, I was able to figure out classes and public functions which helps me out a metric fuckton.
Could anybody here who is familiar with Razer Hydra positional tracking explain it to me? Specifically the one used for the Oculus Rift Hydradeck demo? I want to incorporate something like that into a project but I want to know how it works
[QUOTE=Huabear;44134595]Die rolling with board movement & random names working. building selection is still really wonky though.
[/QUOTE]
When i get a 9 it only moves 3 spaces, it's normal?
This controller is killing me.
A few days ago I had an idea how to make it but now I realized that the idea didn't worked.
Basically I've got no controller and I don't really know how to make one.
try making a basic controller where a key input = movement of some form
[QUOTE=BoowmanTech;44138077]This controller is killing me.
A few days ago I had an idea how to make it but now I realized that the idea didn't worked.
Basically I've got no controller and I don't really know how to make one.[/QUOTE]
The new unity standard assets has a good car controller [URL]http://forum.unity3d.com/threads/223158-New-Standard-Assets-a-k-a-Sample-Assets-Beta-Release[/URL]
That's what you're making, right?
[QUOTE=Johnny Guitar;44138282]try making a basic controller where a key input = movement of some form[/QUOTE]
I've got the basics how to make a controller like, move a object left,right,up,down, and the mouse look.
But I can't figure out how to make the camera stay behind the object and follow like in racing games.
[editline]5th March 2014[/editline]
[QUOTE=Pelf;44139630]The new unity standard assets has a good car controller [URL]http://forum.unity3d.com/threads/223158-New-Standard-Assets-a-k-a-Sample-Assets-Beta-Release[/URL]
That's what you're making, right?[/QUOTE]
Yes that's what I need, I will check it.
Thanks
Anyone knows any way how to get good at programming in a short term(3 months)
I am not talking about expert, and I am going to dedicate myself but I just don't know what to look for and what to do.
I found different tutorials/PDFs but I don't know which one to follow because there are so many.
Should I rather watch tutorials and do what they do step by step or try to make my own things(which might take weeks/months if I get stuck)
[QUOTE=BoowmanTech;44141613]Anyone knows any way how to get good at programming in a short term(3 months)
I am not talking about expert, and I am going to dedicate myself but I just don't know what to look for and what to do.
I found different tutorials/PDFs but I don't know which one to follow because there are so many.
Should I rather watch tutorials and do what they do step by step or try to make my own things(which might take weeks/months if I get stuck)[/QUOTE]
Personally, I learn best when I just make stuff. I'm not a fan of tutorials so when I have an idea for something I think would be cool and fun to make, I try making it. I usually develop programming skills over time and then go back and reprogram what I've already made (ive probably refactored my lander controller script at least half a dozen times). If I ever come across something I don't know about while making stuff (like properties, singletons, static types to name a few) I read up on the basics of them and I end up using them later on, learning more about them as I use them.
Although that may not be what you want to do. That approach works for me but that's because I'm just concerned about making something, not learning programming.
[QUOTE=BoowmanTech;44141613]Anyone knows any way how to get good at programming in a short term(3 months)
I am not talking about expert, and I am going to dedicate myself but I just don't know what to look for and what to do.
I found different tutorials/PDFs but I don't know which one to follow because there are so many.
Should I rather watch tutorials and do what they do step by step or try to make my own things(which might take weeks/months if I get stuck)[/QUOTE]
I'd go to your local book store and find a unity 3 or 4 programming book. I've got a few and they helped me a lot. One I found extremely useful was [url=http://www.amazon.com/Beginning-Game-Development-Unity-All-/dp/1430248998/ref=sr_1_1?s=books&ie=UTF8&qid=1394067300&sr=1-1&keywords=unity+3d]this one[/url], specifically the Unity 3 version, but I doubt much has changed between them. It's pricey, but Sue Blackman, the author, can explain things really well.
[editline]5th March 2014[/editline]
Secondly, can someone explain a static function to me? I'm still trying to make a function that I can plop in one script and any other script on the scene can use it.
[QUOTE=Trekintosh;44142529]Secondly, can someone explain a static function to me? I'm still trying to make a function that I can plop in one script and any other script on the scene can use it.[/QUOTE]
If you use c# then this will probably be useful: [URL]http://msdn.microsoft.com/en-us/library/79b3xss3.aspx[/URL]
[QUOTE=Pelf;44142624]If you use c# then this will probably be useful: [URL]http://msdn.microsoft.com/en-us/library/79b3xss3.aspx[/URL][/QUOTE]
I don't use C# but I was able to determine from that that a static function is not what I needed. I figured out that if I use a public class with only one constructor and one variable, and the constructor is the previous function and instead of returning a string it sets the variable to it, I can just read the variable to get what I need.
I'm not sure how long I'm going to last with this but I'm going to give it a shot.
I've only been using Unity for a couple of months and have little scripting experience with C sharp. I know absolute basics and things that I took in C and "advanced C" classes. I plan on making a game that uses the first person perspective (won't say FPS) but also plan on porting to android.
If I planned on making any amount of money from my "app" then Which assets could I use without getting my ass handed to me? Would I be able to use any unity packages? Scripts?
[QUOTE=gonzalolog;44136145]When i get a 9 it only moves 3 spaces, it's normal?[/QUOTE]
Did that only happen on a roll of 9?
[QUOTE=Pelf;44142509]Personally, I learn best when I just make stuff. I'm not a fan of tutorials so when I have an idea for something I think would be cool and fun to make, I try making it. I usually develop programming skills over time and then go back and reprogram what I've already made (ive probably refactored my lander controller script at least half a dozen times). If I ever come across something I don't know about while making stuff (like properties, singletons, static types to name a few) I read up on the basics of them and I end up using them later on, learning more about them as I use them.
Although that may not be what you want to do. That approach works for me but that's because I'm just concerned about making something, not learning programming.[/QUOTE]
That might be it, and I agree with you, it's better to try to make the things than follow tutorial(you learn more by making things)
But when I get stuck and I can't find a way out it's hard and I don't really like to abandon that project and start a new one until I figure that thing out.
[editline]6th March 2014[/editline]
[QUOTE=Trekintosh;44142529]I'd go to your local book store and find a unity 3 or 4 programming book. I've got a few and they helped me a lot. One I found extremely useful was [url=http://www.amazon.com/Beginning-Game-Development-Unity-All-/dp/1430248998/ref=sr_1_1?s=books&ie=UTF8&qid=1394067300&sr=1-1&keywords=unity+3d]this one[/url], specifically the Unity 3 version, but I doubt much has changed between them. It's pricey, but Sue Blackman, the author, can explain things really well.
[editline]5th March 2014[/editline]
Secondly, can someone explain a static function to me? I'm still trying to make a function that I can plop in one script and any other script on the scene can use it.[/QUOTE]
I will give it a shot, thanks.
[QUOTE=BoowmanTech;44146040]That might be it, and I agree with you, it's better to try to make the things than follow tutorial(you learn more by making things)
But when I get stuck and I can't find a way out it's hard and I don't really like to abandon that project and start a new one until I figure that thing out.
[editline]6th March 2014[/editline]
I will give it a shot, thanks.[/QUOTE]
One thing I want to mention is I didn't actually follow the tutorials in [I]any[/I] of the programming books I read. I used them to understand specific operations and functions. For example in a couple of them there are different ways to manage an inventory. I was able to use those since that's independent of the actual tutorial of the book. And when I started the Blackman book, I hadn't used Unity at all before. My only coding experience was in Expression 2 in GMod and on my TI calculator.
Question time: Is there any way to have an array contain different types of information? I'm going to be using a multidimensional array to store all the parts on my ship, specifically the gameobject of the sprite part, its position in X and Y on the part grid, its weight, and its name. Is it possible to have a gameobject, a string, and a handful of integers on the Y axis of an array? Or is there some other way to make an array of arrays?
[editline]6th March 2014[/editline]
Actually scratch that question. I just remembered all my recent learning about classes. One array, with a ShipPartStats class variable in it. Easy as shit.
[editline]6th March 2014[/editline]
Okay, new question: How would I best go about having a gameobject snap to a grid while following the mouse?
[editline]6th March 2014[/editline]
[del]Great, more trouble. Now I'm having difficulty with finding my controller object.
[CODE]var ScriptController : GameObject;
ScriptController = GameObject.Find("scriptcontroller");
//This broadcasts the important info to the part manager
ScriptController.BroadcastMessage("NewPart",*long inputs of part class*);[/CODE]
it gives me 'GameObject is not a member of EditorPart' (EditorPart is the name of the script running this code) What am I doing wrong here?[/del]
Ignore the latest question. In the long set of variables I was broadcasting, I had typed this.GameObject, instead of this.gameObject. that was what was throwing the script. One step closer to a real game!
Im trying to draw a grid over a plain using
[csharp]
using UnityEngine;
using System.Collections;
public class grid : MonoBehaviour {
public int GridSpacing = 5;
public Color GridColor = Color.yellow;
private Vector2 gridSize;
private Material lineMaterial;
// Use this for initialization
void Start () {
gridSize = GameObject.Find("Plane").transform.localScale;
lineMaterial = new Material( "Shader \"Lines/Colored Blended\" {" +
"SubShader { Pass { " +
" Blend SrcAlpha OneMinusSrcAlpha " +
" ZWrite Off Cull Off Fog { Mode Off } " +
" BindChannels {" +
" Bind \"vertex\", vertex Bind \"color\", color }" +
"} } }" );
lineMaterial.hideFlags = HideFlags.HideAndDontSave;
lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
}
// Update is called once per frame
void OnPostDraw () {
lineMaterial.SetPass(0);
GL.Begin( GL.LINES );
GL.Color(GridColor);
int halfX = (int)(gridSize.x / 2);
int halfY = (int)(gridSize.y / 2);
for (int x = - halfX; x <= halfX; x+=GridSpacing) {
GL.Vertex3 (x, 0, halfY);
GL.Vertex3 (x, 0, -halfY);
}
for (int y = -halfY; y <= halfY; y+=GridSpacing) {
GL.Vertex3 (-halfX, 0, y);
GL.Vertex3 (halfX, 0, y);
}
GL.End();
}
}
[/csharp]
attached to the camera, but its not drawn (or is drawn behind the plane) when drawing the plane, and is just a small line when I disable the plane's renderer
[IMG]http://i.imgur.com/0y5vR2K.png[/IMG]
Sorry, you need to Log In to post a reply to this thread.