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 /
This question was closed May 17, 2016 at 08:38 AM by salrad for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by salrad · May 16, 2016 at 09:23 PM · unity 5unity 2drigidbody2dvelocitymovement script

Player is not moving

I have this code in the update function

  if(Input.GetKey(KeyCode.D))
         {
             rg2d.velocity = new Vector2(speed, rg2d.velocity.y);
         }



and I set the speed to 50f but the rigidbody won't move I checked the apply root motion and it is unchecked and I have this code for jumping

 rg2d.velocity = new Vector2(0, jumpDist);

and it is working fine...could someone explain to me what is the problem here??

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 aballif · May 16, 2016 at 09:27 PM 1
Share

Wouldn't it be better to add Force to the Rigidbody2D?

avatar image salrad aballif · May 16, 2016 at 09:48 PM 0
Share

I tried that also and I faced the same problem...I don't know what am I missing

avatar image tanoshimi · May 16, 2016 at 09:50 PM 1
Share

Please paste your complete Update() function.

avatar image salrad · May 17, 2016 at 08:37 AM 0
Share

I figured it out it was my bad :D I accidentally checked the freeze position x in rigid body 2d component...I hope this helps someone out there

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

,Rotate a gameobject around another while being attracted by its gravity 1 Answer

Rigidbody2D giving incorrect value 1 Answer

Do rigidbodies (especially 2d) have limits on their velocities? 1 Answer

Velocity Randomly resets to (0, 0) 0 Answers

How to Create a Launch Path? 2 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