- Home /
Tutorial level
I would like a tutorial that will not allow the character to pass till he does something... It's going to be a tutorial level... So basically I will have a fence, then a character will say something about you can't pass the gate till you... for instance go kill three attackers, or you jump up to somewhere. Thanks... I have no idea how to make this script sooo please don't tell me to try myself.
I thank anyone who answers this!
Answer by xmcdeath · Nov 29, 2012 at 12:14 AM
Sounds like you are asking someone to make the script for you by asking to "please don't tell me to try it myself".
If you would like to know how to make a script, and I'm not trying to be mean, I will gladly help you, but the reality is nobody will do the work for you. So if you are willing to learn for yourself and hopefully someday be able to put all of your great ideas into an actual game, that's what we need.
If everybody had everything handed to them, nobody would learn.
So here are some basic scripting resources:
The official unity scripting tutorial (of course :)
The tornado twins do a great job of explaining to beginners
and finally, as part of the "do it yourself" philosophy, Google!
So go out there, learn, and make a great game.
And if you ever have any questions relating to a specific topic in scripting, feel free to shoot me a message on the forums.
No no, and I didn't take it that way. I was just trying to help by offering what i knew. If you didn't hear it from me, somebody else would have told you, or the question would have just gone unanswered.
If you actually have attempted, post some of your scripts. When you do that it makes you look like you know what your doing, thus making it easier to find an answer
Now here is the thing I don't know what i'm doing... I am trying to learn some like C# but having a problem, you give me a while and in like oh a week or so check back afetr I try to work my way threw it.
Answer by Chronos-L · Nov 29, 2012 at 04:52 AM
I am assuming that you have a considerate amount of knowledge and experiences in scripting and have understanding in polymorphism.
You can use an objective system combined with a manager.
This is a generic Objective class
public class Objective : MonoBehaviour {
public String getDescription();
public bool isCompleted();
}
You can extend it to other objectives: kill x-number of enemy, find key, run for 3 seconds, press the W,A,S,D keys to move your character etc...
//Example: This objective checks for kill x-number of enemy
public class KillCount : Objective {
private int count = 0;
public int targetCount = 5;
....
public void increase() {
//There are multiple ways to invoke this function
count++;
}
public bool isCompleted() {
return ( count > targetCount );
}
}
You can then use a manager to keep track of these objectives.
public class ObjectiveManager : MonoBehaviour{
//A list of objectives
...
void Update() {
...
if ( objective.isCompleted() ) {
//Do whatever you want here
}
}
}
You can extends this to an achievement system (tweaks and changes are required). I am just throwing down some ideas here, hopes that this will help.
See I like that^... He doesn't give me the asnwer so I have to work it oput, but he's still helping and given me basis... THAN$$anonymous$$S!
Oh how exactly would I list em... Isn't it like:
object 1, kjl, tkh, obj 3
and make the last one without a comma?
You should used an array of the generic Objective type. You can then assign different kinds of objectives you have built: $$anonymous$$illCountObjective, CollectObjective, $$anonymous$$oveToObjective etc.
I havn't had time to use this... when I do I will giv this as the correct anser
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Setting Scroll View Width GUILayout 1 Answer
Can someone help me fix my Javascript for Flickering Light? 6 Answers
C# scriping help 0 Answers
Inventory system Help 2 Answers