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 MOLB · Jan 04, 2012 at 07:52 AM · timesavecrosshair

Some questions that needs answers.

Hi

I have three question that I need help with.

1: Is there any time commando like in C++? Let's say I have a function, so when a function is executed I want some things to happen. And after the time that was inputed in that commando, the things under this commando (in the script) will be executed.

2: How can I make a script that creates a save file, and in the save file there will be saved intiatures, floats, boolean? Or is there a way to save in a better way?

3: Whay is the best way to create a 2D crosshair that the weapon follows? Because I can make it so the weapon/gun targets the crosshair. Or is there a better way to do it.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by CHPedersen · Jan 04, 2012 at 09:18 AM

1:

Scheduling events to occur after a specific amount of time has passed is done using Coroutines, and the "WaitForSeconds(float)" yield instruction in particular. Study this page:

http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html

2:

Saving single variables is efficiently and easily done using PlayerPrefs, study them here:

http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html

If you need more complicated data written to a file, you should resort to the various IO classes in .Net. It's possible you can format it as a string and put it all in a file with a single line of code using File.WriteAllText, but this depends largely on your specific use scenario.

3:

That question has been asked a gazillion times. Try to google for "Unity3d Crosshair", and you'll find plenty of hits. There is even a youtube tutorial for that particular purpose here:

http://www.youtube.com/results?search_query=Unity3d+crosshair&oq=Unity3d+crosshair&aq=f&aqi=&aql=&gs_sm=e&gs_upl=346l3746l0l3986l19l16l1l9l10l0l161l497l4.2l6l0

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 MOLB · Jan 05, 2012 at 09:55 AM 0
Share

Thank you for your help.

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

6 People are following this question.

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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Trying to delay movement of a GameObject 1 Answer

deltatime glitches 1 Answer

How do i place a crosshair to my ray cast? 1 Answer

Problem with time !! help me 1 Answer


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