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 kilian277 · Nov 01, 2010 at 07:04 PM · missions

How to trigger a mission in a FREE-roam world

Hi How to make a mission trigger in a free-roam world like in GTA 4

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by duck · Nov 01, 2010 at 07:28 PM

Well, very broadly speaking, you could use a trigger collider to trigger a function when the player enters that zone.

However, it's difficult to answer this question in any more detail because it is such a broad topic!

In fact, the design problem of creating a general-purpose system of defining your missions is a much larger task than working out how to trigger them once they are set up. For example, a mission definition would probably have some kind of route definition consisting of multiple targets or waypoints, information about which enemies spawn, and at what time, and pieces of scripted dialogue which might occur at certain points.

Ideally, your system would need to allow for as much variation as you need, while still being generic enough to avoid having to write custom gameplay code for every mission.

Since this is a topic that could easily fill a chapter of a book, you'll have to start narrowing this down to more specific problems to get further help.

Good luck!

Comment
Add comment · 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
1

Answer by HolBol · Nov 01, 2010 at 07:58 PM

Dude, it's obvious you have some high expectations even though you're probably very new to games dev. Start out with something small. Making a free-roam world will take countless hours from your time, and even getting close to GTA 4's standard would be an amazing achievement for just one person. I recommend starting out much smaller, maybe look at the TornadoTwins tutorials on youtube to get you started. Do this, then each time you make another project, just make it a little bit bigger. Add something new in, whatever.

Anyway, before I disregard this question completely, I'll answer.

If (on a simple level) you want to launch a mission the way GTA 4 does, you'll need to script it so when the player enters the trigger, a new scene is loaded. Something along the lines of this :

//This is in JavaScript, ok?

//this variable lets us pick the scene number //(in the build settings) from the editor. var leveltoload = 1;

//when this trigger is entered. function OnTriggerEnter() {

//load the level number in the variable application.LoadLevel(leveltoload); }

Just attach this to a box collider and mark it as a 'trigger' in the editor, and attach the above script to it. Now, make sure you have 2 scenes in the build settings, the one with the collider in, and the other being the level you want to load. Now walk your character (the stock fps controller should be fine for now) into the trigger object you made, et voila! Scene loaded.

It will take a lot to get to GTA4's scene loading, as you'll have cutscenes to load instead, camera fading and many other things to do.

Just remember: Use this as a starter, and build on it. Look through the Unity manuals, watch some videos and read some tutorials. Then you're set to go.

Comment
Add comment · Show 1 · 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 SrBilyon · Nov 01, 2010 at 08:36 PM 0
Share

Implying that $$anonymous$$ilian is a novice.

Anyway, very detailed answer.
avatar image
0

Answer by StephanK · Nov 01, 2010 at 07:29 PM

That depends on what condition you want to trigger the mission. The easiest way would be a trigger collider placed anywhere in your world. If the player enters this collider you could trigger your mission/events whatever.

Comment
Add comment · 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

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

No one has followed this question yet.

Related Questions

How can I make Game Objectives? 1 Answer

Best way to store / activate levels in a game? 1 Answer

Create missions system like subway surfer or Danger boat 1 Answer

Mission system, Postal service delivery game 0 Answers

Need Help With Mission Gen. 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