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 cakegamer · Jan 16, 2014 at 07:57 PM · side-scrolling

qrest system

i am makeing a 2d sidescrolling offies sim for fbla but i wont to put in a qrest system like you talk to some one then you go to a computer and pres e and it wold then take you to the next level or unlock the next npc qrest to do how wold i do that ples help

ps i have dislexsya

Comment
Add comment · Show 4
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 deltamish · Jan 16, 2014 at 08:03 PM 0
Share

HI,Thats quite simple(but you ned to know about Send$$anonymous$$essage and delegates(optional))

All i would do is

Check for trigger with the npc(person you would talk to) using OnTriggerEnter (Check docs for further info)

and then in the script (player script with some thing like canload = true) i would update it

and then check for trigger once agian to see if player is near door

then when you press E

load the lvel using

 if(Input.Get$$anonymous$$ey($$anonymous$$eyCode.E))
 {
 Application.LoadLevel("Your level name");
 }

Soory i could write the script as its too late and i nned to get back to bed

avatar image HuskyPanda213 · Jan 17, 2014 at 04:11 AM 0
Share

Do not use ontriggerenter, it is bugged(for me atleast), and hogs up colliders/performace, use vector3.distance.

avatar image getyour411 · Jan 17, 2014 at 04:30 AM 2
Share

Not to thread hijack, but... OnTriggerEnter is not bugged and is fine to use; calculating unecessary distance checks every frame if it's put in Update() sounds like bad advice. If you have a Profiler output that shows otherwise, I would like to see it.

avatar image deltamish · Jan 17, 2014 at 07:47 PM 0
Share

Hi, @HuskyPanda213

Never use Vector3.Distance it uses much more memmory as it has to calculate SuqareRoot

So i would rather suggest using

 (Position2 - Position1).sqr$$anonymous$$agnitude

Even better is using OnTrigger Function which is optimized as all calculation are done by NvidiaPhysx Engine in an another thread

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by cakegamer · Jan 17, 2014 at 03:45 PM

but i wont it wer i pres e on a object like a computer and then it unlock the npc so you can speek to them and get teliported to next level how wold i do that?

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

20 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

2d sidescroler offies sim qrest system for fbla 0 Answers

How To Make GUI Buttons Load/Quit 1 Answer

hide child object script - help 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 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