Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Jul 17, 2017 at 10:09 PM by FortisVenaliter for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Team_26 · Dec 21, 2013 at 11:00 PM · movementrigidbodywork

rigidbody2D.AddForce doesn't work!

Why does this code doesn't work?

rigidbody2D.AddForce(transform.up Speed Time.deltaTime);

This AddForce doesn't move my gameobject. Have you got any ideas?

Thanks for you statement!

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 robertbu · Dec 21, 2013 at 11:02 PM 0
Share

What the mass? How big is 'Speed'? Is there a possibility that the object is hitting another collider? Note the use of 'Speed' here is misleading since this code will not make something go a specific speed.

avatar image Statement · Dec 21, 2013 at 11:13 PM 0
Share

Is the rigidbody kinematic?

avatar image Team_26 · Dec 21, 2013 at 11:14 PM 0
Share

Speed is 10. $$anonymous$$ass of this gameobject is 1.

avatar image Team_26 · Dec 21, 2013 at 11:21 PM 0
Share

Yes, it is. When I uncheck "Is $$anonymous$$inematic" gameobject fall.

avatar image Statement · Dec 21, 2013 at 11:24 PM 0
Share

Please don't post your comments as answers. I've converted your "answers" back into comments but please try to understand the comments system for next time :) There's also a tutorial video here that helps you understand Unity Answers.

3 Replies

  • Sort: 
avatar image
4
Best Answer

Answer by Statement · Dec 21, 2013 at 11:23 PM

Set the following options on Rigidbody 2D

  • Is Kinematic: Off

  • Gravity Scale: 0

Documentation for Rigidbody 2D

alt text

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
2

Answer by jobar · May 11, 2014 at 12:53 AM

The previous responses are correct, you need to be aware of the settings in the inspector and the values you use in the function call. Also, Time.deltaTime produces a small value which can likely lead a force that is unlikely to overcome gravity. For instance,

  rigidbody2D.AddForce(Vector3.up * 10 * Time.deltaTime);

might not produce a force strong enough to overcome gravity, but if you try something like

  rigidbody2D.AddForce(Vector3.up * 300);

you will likely see something happen.

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 zomboy_ · Mar 21, 2015 at 04:43 AM 0
Share

This is worked for me..but when i move player it keep moving after i finished my touch player keep moving.and also player accelerate his speed continusly

avatar image
-1

Answer by Nolaa_Uzul · Jul 17, 2017 at 10:02 PM

Set BodyType = dynamic Simulated = on GravityScale = 0

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

Follow this Question

Answers Answers and Comments

22 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

Related Questions

Unwanted 2d pixel after-image when moving 1 Answer

onTriggerEnter only triggers when the gameobject its shall hit moves. 1 Answer

Erratics movements from my rigidbody : why does it behave like that? 0 Answers

Rigidbody slows down before touching its target 1 Answer

2D Game, Character Slides off Slopes, Need to be Able to Walk on Them 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