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
0
Question by Gambit 3 · Mar 22, 2011 at 10:15 AM · screenlockkeypressproximity

proximity, keypress and mouse lock help please :)

hey guys :D

im just messing around with unity trying to get the hang of how it all works.

im a programmer :S..might not mean much :S.

anyways, iv come to a little roadblock that i cant really pass.

1: i need to find a way to lock the mouse position to the center of the screen, yet still be able to look around.

2: i need to find a way to lock the screen from moving, and be able to move the mouse around without moving the players view.

3: iv made a cylinder (for the sake of the test) that is solid and everything. but i need to make it so that when your in a certain distance from the cylinder, you press the designated k (just e will do), it pops up a menu (thats why i need to lock the screen and stop it from moving, and still be able to move the mouse)

any help is appreciated :D

thanks in advance.

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
1

Answer by AngryOldMan · Mar 22, 2011 at 11:58 AM

if it's a pause menu you would benefit from something like

function Update () 
{
    if (Input.GetButtonDown ("p")) 
    {
        if (GUIshow == 0)
        {   
            Time.timeScale = 0.0;
            GUIshow = 1;
        }
        else
        {
            GUIshow = 0;
            Time.timeScale = 1.0;
            Time.fixedDeltaTime = 0.02 * Time.timeScale;
        }
    }
}

This should cover the 2nd two questions, You can always press Esc key in game and it will show your mouse (however it still moves your character's view) so you need to "pause" the game. As for your 1st question http://unity3d.com/support/resources/tutorials/fpstutorial.html check out the FPS tutorial, there should also be a 1st person mouse look script in the standrard assetts but hav'nt used them since several versions ago so I'm no scholar regarding them.

Comment
Add comment · Show 2 · 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 Gambit 3 · Mar 27, 2011 at 02:57 AM 0
Share

timedscale does nothing for me :(

avatar image AngryOldMan · Mar 27, 2011 at 08:52 PM 0
Share

and your comment doesn't really give me any information as to how anyone can 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

No one has followed this question yet.

Related Questions

How do I create a toggle for showing cursor and then hiding cursor? 1 Answer

Lock the screen 1 Answer

Modifying the pause menu to have screen.lockcursor on at start 1 Answer

Locking the cursor in the center of the screen 1 Answer

Screen.lockCursor not working? 3 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