Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by JBoy · May 16, 2012 at 11:14 AM · rigidbodyforcelocal

rigidbody.addforce forward locally?

How do i apply rigidbody force on the local Z axis?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Kryptos · May 16, 2012 at 11:55 AM

You get the local z axis, with transform.forward:

 Vector3 v3Force = strength*transform.forward
 rigidbody.AddForce(v3Force);
Comment
Add comment · Show 2 · 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 Bazsee · May 16, 2012 at 12:01 PM 0
Share

ah i missed the 'local' word. your answer is correct

avatar image JBoy · May 17, 2012 at 01:55 AM 0
Share

Thanks Nick!

avatar image
12

Answer by TyJake · Oct 17, 2014 at 07:12 PM

I'm pretty sure that this is what most (noobs) searching on this subject are looking for.

AddRelativeForce.

Yes...sometimes it is THAT simple. :) Don't worry..it has racked the brains of most of us non "natural" coders.

rigidbody.AddRelativeForce (Vector3.forward * 10);

Comment
Add comment · Show 3 · 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 josephquested · Aug 27, 2020 at 05:54 AM 0
Share

yep thats me. been using unity for six years and yet somehow i was that exact noob right now

avatar image NotToxic-WLH · Oct 10, 2020 at 02:04 PM 0
Share

lol i struggled for 1 hour searching for a solution then i found that i already had it i just didn t add enough force to move the object.

avatar image Cosmology27 · Apr 29, 2021 at 12:50 AM 0
Share

So I'm so noobish that I'm still confused here, haha. In this case I want to take however much the Input.GetAxis ("Vertical") is, and I want that to be the force being added forwards. In your case, you're adding the force of Vector3.forward, and I don't know what that means. Mind helping?

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

11 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

Related Questions

How to fix/clamp rigidbody dir vector, despite Force dir 1 Answer

How to change velocity of object which move by Rigidbody. 1 Answer

Movement Physics: Max Speed and Momentun 0 Answers

Predicting land position with drag applied 0 Answers

relative velocity of rigidbody according to rotation... 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