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
1
Question by no00ob · Aug 19, 2018 at 07:01 PM · rotationmovementtransformdebugdebugging

How can I see what line of my code is moving my object?

I have a fairly long script that has all kinds of different methods for movement and so on. The problem I'm having is that my object keeps moving on it's own upwards and I can't figure out what line/method is causing that, I know I could debug all day and probably find it, but I don't have time for that so if anyone knows of any method like debug.log that would display what line is moving the object or something. If someone wants to see the script and is willing to help me I will show it.

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 eses · Aug 20, 2018 at 01:19 PM 2
Share

Hi @no00ob

"I know I could debug all day and probably find it, but I don't have time"

Is this actually a question or just some sort of rant?

You don't show your code. You acknowledge it has become complicated for you. You say you don't want to debug it (which would be a reasonable solution) - what could we do?

How about you try to find all possible methods Unity uses to move objects? Like Transform.translate, Rigidbody.$$anonymous$$ovePosition, velocity, and see on which lines you have used these. That way you find what is moving your object. Or post the code for others to see.

avatar image no00ob eses · Aug 20, 2018 at 06:20 PM 0
Share

Sorry if I sounded a little rude I didn't mean to and no my code isn't too complex it's just that debugging 500 lines takes time when almost every line has a bool or method related to movement and I was wondering if there was a easier method so I don't end up doing the debugging for nothing but obviously if there isn't then I'll do the debugging. Like you said that's probably the best solution since if unity doesn't have a method for that. Thanks! (Also the reason I don't post the code is because it's already so advanced I don't want people to s$$anonymous$$l it and use it themselves)

avatar image NoDumbQuestion · Aug 21, 2018 at 02:17 AM 1
Share

Play the game. Delete that gameobject.

Any reference to that gameobject will be lost (it might throw null reception as gameobject is gone). And then the only thing can move your GameObject is attached script.

Try remove attached script one by one. Find the faulty script you wrote. Press Ctrl+F. search for transform

avatar image no00ob NoDumbQuestion · Aug 21, 2018 at 05:39 AM 0
Share

I'm so thankful I didn't start debugging yet, that's pretty good idea I'll be sure to do that to make my life easier thank you!

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by no00ob · Aug 21, 2018 at 08:02 PM

Ok as it turns out its totally not my scripts it is the rigidbody any suggestions how to stop it from moving my object? :I

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

Answer by ju_my · Aug 21, 2018 at 09:29 PM

Hi, is "use gravity" ckecked on your rigidbody Component?

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 no00ob · Aug 22, 2018 at 05:37 AM 0
Share

No I have disabled that but it still keeps doing that

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

237 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 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 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

Record and replay movement 0 Answers

My Prefab goes crazy and it moves faster when i click in another thing of the unity editor or the scene even if that didn't suppose to happen 0 Answers

Camera Rotation every time a key is pressed 0 Answers

How to Stack, Shuffle and deal cards 0 Answers

i'm using a code to make my cube walk with character controller but when i play the cube spins. 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