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 /
avatar image
0
Question by ham · Aug 13, 2013 at 09:35 AM · movementrigidbody.addforce

monotone movement with rigidbody.addforce

hi guys , here is a very .... problem ,would anybody help me plz.... i wanna shoot a bullet in a curve path with rigidbody.addforce but when i instantiate it and apply addforce on it , its got a rapid movement at the begining and slower movement at the falling part , this is the code ive written

 function OnMouseDown ()
 {
     var DirectionVec : Vector2 = Vector2(1,1);
     Clone =Instantiate ( Bullet , transform.position , transform.rotation);
     Clone.rigidbody.AddForce (DirectionVec * Time.deltaTime *  30000 ) ;
 
 }

ofcourse i turn use gravity on ... and also when i use addforce in several frames such as in update function ive got problem with the curve path , mean that the bullet doesnt move correctly in the curve... so i explain my problem again .maybe the answer helped other too i have a bullet that wanna move it in a arc path ,my solution is that apply addforcr in just one frame and turn the gravity on , so that after reaching the bullet to apex point it falls with gravity, but the frist half of movement is too quick and the second is slow ,or they havent same speed......... so would anybody..... thanx again and again thanx

Comment
Add comment
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

· Add your reply
  • Sort: 
avatar image
0

Answer by Narv · Aug 13, 2013 at 11:12 AM

It looks like you are trying to change the way the force is applied, correct? AddForce has a 2nd optional parameter you can use

http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.AddForce.html

It takes a ForceMode. You can control how the force is applied (at once, or continuous) and with or without regard to mass:

http://docs.unity3d.com/Documentation/ScriptReference/ForceMode.html

Comment
Add comment · Show 4 · 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 ham · Aug 13, 2013 at 04:22 PM 0
Share

ill check it my friends , right now ..just thanx

avatar image ham · Aug 14, 2013 at 12:41 AM 0
Share

alt text

im checking it , but seems that theres an untold problem, i wanna reach from a to b , whats my best solution,shuld i apply force in just on frame and turn the gravity on ? or.....if i want to make it more simple , its something like the birds movement in the angrybird...for example how the birds move slowly in their curve path and again thanx

untitled-2.gif (9.8 kB)
avatar image ham · Aug 14, 2013 at 12:49 AM 0
Share

im completely confused now.... without gravity we cant have a curve movement and with gravity and in just one frame applying addforce , we have faster movement till apex point and slower , the remaining path

avatar image ham · Aug 15, 2013 at 01:41 PM 0
Share

i solved the first part of problem , i had a mistake in setting the camera orthographic size , it was set on 3 , now ive changed this parameter to 100 , and now i can have the full motion slow and , but the second part of problem is the movement isnt so gentle ,and its kindly frame by frame !!!

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

16 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

Related Questions

Input.GetAxisRaw("horizontal") not working 1 Answer

Moving rigidbody (Player) with addForce or Velocity ? 1 Answer

How do I stop unwanted rotations? 4 Answers

Character on platform move slowly 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 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