Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by kbeaud · Nov 29, 2012 at 12:05 AM · c#javascript

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!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3

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.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image xmcdeath · Nov 29, 2012 at 12:23 AM 0
Share

And if you ever have any questions relating to a specific topic in scripting, feel free to shoot me a message on the forums.

avatar image xmcdeath · Nov 29, 2012 at 12:25 AM 0
Share

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.

avatar image xmcdeath · Nov 29, 2012 at 12:25 AM 0
Share

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

avatar image kbeaud · Nov 29, 2012 at 12:42 AM 0
Share

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.

Show more comments
avatar image
2

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.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kbeaud · Nov 30, 2012 at 01:46 AM 0
Share

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!

avatar image kbeaud · Nov 30, 2012 at 01:48 AM 0
Share

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?

avatar image Chronos-L · Nov 30, 2012 at 03:48 AM 0
Share

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.

avatar image kbeaud · Dec 01, 2012 at 10:00 PM 0
Share

I havn't had time to use this... when I do I will giv this as the correct anser

avatar image kannan21 · Dec 24, 2015 at 09:23 AM 0
Share

@Chronos-L Good one.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges