• 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
Question by noamraz · Apr 07, 2020 at 11:42 PM · movementtransformscalebugsbug report

With No Reason, My Character Stopped Looking To the Way She Goes.

Hi, I am Noam, I'm a beginner In unity and I made a game using unity. Till now all was good. I just tried to remake things I loved in other games. And today after adding an animation, My Character Just Stopped Moving to Her Right way. I didn't Make ANY change in the code and she just not Doing it.

Photo:

character don't changing sides

It started 2 weeks ago when I tried to make an item that changes her color and it didn't work. Even Manually Changing Through the Inspector In PlayMode didn't changed her color and I forgot that but now, it's happening even with the Looking. It didn't worked manually too. I need it to work.

I don't know If it's a problem of unity or not but I really want to finish that game and continue using unity for game making and that is very annoying that you make a game and it is working just for the first week and then dies. Please Help Someone. that's very important to me.

( I Wrote The Movement Code and Color code from Tutorials so I'm pretty sure it's not my "beginnery" thing.)

EDIT: Solved It. That was The Animation...

If you need it this is the input code:

 private void InputManager()
     {
         //horizontal moving axis
         float hDirection = Input.GetAxis("Horizontal");
 
         //animation speed
         anim.speed = 1;
 
         //shift clicking for speeding the character
         if (Input.GetKey(KeyCode.LeftShift))
         {
             //making the moving speed faster
             nowMoveSpeed = normalMoveSpeed + fastMoveSpeed;
             //making the animation faster
             anim.speed = 2;
         }
         //if the shift is not clicked
         else if (!Input.GetKey(KeyCode.LeftShift))
         {
             //normalizing the moving speed
             nowMoveSpeed = normalMoveSpeed;
             //normalizing the animation speed
             anim.speed = 1;
         }
 
         //right movement
         if (hDirection > 0)
         {
             //RigidBody move forcing
             rb.velocity = new Vector2(nowMoveSpeed, rb.velocity.y);
             //make the character look to the right place
             transform.localScale = new Vector2(1, 1);
             PlayerName.transform.localScale = new Vector2(0.01384126f, 0.01384126f);
         }
         //left movement
         else if (hDirection < 0)
         {
             //RigidBody move forcing
             rb.velocity = new Vector2(-nowMoveSpeed, rb.velocity.y);
             //make the character look to the right place
             transform.localScale = new Vector2(-1, 1);
             PlayerName.transform.localScale = new Vector2(-0.01384126f, 0.01384126f);
         }
         else
         {
             //if not clicking on any key the program needs to do nothing
         }
 
         //jumping, and make a jump number limitation
         //if the jumping key pressed, and the character is not touching the ground
         if (Input.GetButtonDown("Jump") && coll.IsTouchingLayers(ground))
         {
             Jump();
         }
         //if the jumping key pressed, and the jump count is less then the accepted jumps in one jump
         else if (Input.GetButtonDown("Jump") && jumpCount < jumpNumInAir)
         {
             Jump();
         }
         //if the character is just touching the ground
         else if (coll.IsTouchingLayers(ground))
         {
             //jump number will be equal to 0
             jumpCount = 0;
         }
     }


צילום-מסך-505.png (79.6 kB)
Comment

People who like this

0 Show 0
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

  • Sort: 
avatar image
Best Answer

Answer by noamraz · Apr 08, 2020 at 12:14 AM

Just Solved it. The problem was the Animation.. Sorry Unity for judging. You are awesome!

Comment

People who like this

0 Show 0 · 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

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta on June 13. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

209 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

Related Questions

Problem using rotation and Rotate 1 Answer

why is my player deceleration script not working? 0 Answers

How do I create a rubber band effect on a camera forward movement? 1 Answer

How can I move an object a certain distance, once? 2 Answers

How do you Scale Game Objects with the Screen? 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