Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by JoshCunn · Aug 21, 2016 at 01:30 AM · 2d3dmousescene-change

3D FPS to 2D mouse

Alright so I have this game where in the first scene the player is a first person camera that moves with WASD and looks around with the mouse. When I exit the scene, There is a 2D, flat canvas where the player clicks a button and the game continues, but the mouse isn't appearing on the 2D scene. I know it has something to do with the mouse being used to look around on the first scene but I don't know how to fix it. I need to get this game done as soon as possible so any responses help!

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
0

Answer by Jessespike · Aug 21, 2016 at 10:40 AM

Try setting the cursor. Add this to a script in the menu scene.

 void Start() {
     Cursor.lockState = CursorLockMode.None;
     Cursor.visible = true;
 }

Scripting API: Cursor

Scripting API: Cursor.lockState

Comment
Add comment · Show 4 · 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 JoshCunn · Aug 21, 2016 at 07:14 PM 0
Share

Im getting several errors with the code, @Jessespike

  1. Assets/scripts/mouse.cs(7,30): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration

  2. Assets/scripts/mouse.cs(6,10): error CS1031: Type expected

avatar image incorrect JoshCunn · Aug 21, 2016 at 07:21 PM 0
Share

Because you have no idea how program$$anonymous$$g in Unity works. No offence, but you have to learn to code, the community can not do the work for you.

Here is your code. Create the script (the name of the script should match the name of the class 'CursorUnlocker') and attach it somewhere in the scene in which you want to get mouse pointer visible. I'd recommend to create a new GameObject with the same name as the script.

 using UnityEngine;
 
 public class CursorUnlocker : $$anonymous$$onoBehaviour
 {
     void Awake()
     {
         Cursor.lockState = CursorLock$$anonymous$$ode.None;
         Cursor.visible = true;
     }
 }


avatar image JoshCunn incorrect · Aug 21, 2016 at 08:05 PM 0
Share

@incorrect Thanks the code worked. This game I'm making is for a school project and I'm literally doing it to learn code. I'm familiar with JS but C# is brand new to me. Thanks anyway for the help!

Show more comments

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to speed up building at game? 1 Answer

Get Velocity of Rigidbody Object Below Another Object 0 Answers

Light 2D and Performance issues 0 Answers

Detect mouse down on multiple objects from single script? 1 Answer

Check the if mouse clicked on specific tile 0 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