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 mostlyhuman · Jan 07, 2017 at 10:37 PM · visual studiodebugging

Visual Studio Debugging, sometimes can't see value of some local variables

I occasionally come across a locally declared variable that Visual Studio will not show a value for when I am debugging (when i mouse over it or set a watch). If I move the variable declaration outside the local scope I can then see it. Here is an example where the value of targetPos cannot be seen when stepping through the if statement even though it is in scope:

       if (facingDirection == FacingDirection.Back || facingDirection == FacingDirection.Front)
       {
 
          float roundedPosX = (Mathf.Sign(transform.position.x) * (Mathf.Abs((int)transform.position.x) + 0.5f));
          roundedPosX += 0.408f;
 
          Vector3 targetPos = new Vector3(roundedPosX, transform.position.y, transform.position.z);
 
          transform.position = Vector3.MoveTowards(transform.position, targetPos, rotateXAlignSpeed * Time.deltaTime);
       }

Any ideas how to fix this or as to whats going on?

Comment
Add comment · Show 5
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 vals261 · Mar 13, 2019 at 09:50 AM 0
Share

Hello, I know this is very old, but did you fix this problem? I'm experiencing it right now and I'm really struggling.

avatar image xxmariofer vals261 · Mar 13, 2019 at 10:19 AM 0
Share

i have never seen something similar, when you use a breakpoint in for example his transform.position line you cant see targetPos value?

avatar image tormentoarmagedoom · Mar 13, 2019 at 10:23 AM 0
Share

Good day.

Yea, somethimes i have the same issue, but i think its not a bug, its normal. Some variables need to be searched (like "GameObject.Find()") so cant see the value before it spend the resources to search it

avatar image theophilus8765 · Jul 25, 2020 at 03:56 PM 0
Share

I am having this problem too.

avatar image theforgot3n1 · Jan 23 at 07:34 PM 0
Share

I also have this issue from time to time. No idea what causes it.

0 Replies

· Add your reply
  • Sort: 

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

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

Related Questions

Unity 5.1.1 is skipping code lines 0 Answers

Tools for Unity Visual Studio 2019 1 Answer

Why is VS15 throwing errors for missing namespace 'UnityEngine' when it is already included 0 Answers

Visual Studio 2017 Diagnostic Tools "The Diagnostic Tools window does not support the current debugging configuration" 0 Answers

Cant change debugger execution line while debug 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