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!

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 :slight_smile:

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.

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.