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 Zero_Zagarth · Sep 25, 2012 at 05:16 PM · positionforcelocationworldspecific

Apply force from specific location in space

Hi comunity. I'm trying to make a football game and I need that when the player gives the ball, it will can be launched from a specific point in the space with a force (a trigger, for example, and I determinates this by script). Is that behaviour possible?

Thanks for any answer.

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 Julien-Lynge · Sep 25, 2012 at 05:32 PM 0
Share

Not sure quite what you're asking here, so let me try to rephrase it:

You want to be able to instantiate a game object at a point in space and then apply a force in a specific direction. How does the trigger fit into things?

avatar image Zero_Zagarth · Sep 25, 2012 at 07:10 PM 0
Share

I'm trying to say. I want to move a gameobject from A position to B position using physic force. Is this possible? And how could I do it?

avatar image AlucardJay · Sep 25, 2012 at 08:18 PM 0
Share

You can add an impulse force :

 gameObject.rigidbody.AddForce( transform.forward * forwardForce, Force$$anonymous$$ode.Impulse );

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

though for a realistic effect you may want to AddForce at the edge of the football :

 gameObject.rigidbody.AddForceAtPosition( transform.forward * forwardForce, transform.position + ( -transform.forward * ballRadius ), Force$$anonymous$$ode.Impulse );

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

different force modes : http://docs.unity3d.com/Documentation/ScriptReference/Force$$anonymous$$ode.html

avatar image Zero_Zagarth · Sep 25, 2012 at 08:36 PM 0
Share

Thank you my friend, but maybe I did'nt understand enough fact. I know how add force to the gameobjects. But now, I need to add a scpecific force to my sphere that addresses exactly from a point A to a point B, I need to apply the exactly force necessary to reach the point B. I think that now I have become better understood.

Thank You!

avatar image AlucardJay · Sep 25, 2012 at 08:50 PM 0
Share

I see. Have converted my answer to a comment. You may want something from these links, Aldo has all the answers for this type of thing :

http://answers.unity3d.com/questions/148399/shooting-a-cannonball.html

http://answers.unity3d.com/questions/145972/how-to-make-enemy-canon-ball-fall-on-mooving-targe.html

http://answers.unity3d.com/questions/296749/display-arc-for-cannons-ball-trajectory.html

0 Replies

· Add your reply
  • Sort: 

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

Finding Position based on a local perspective 1 Answer

Position waypoint along sphere 1 Answer

Problem stopping rigid body after adding a force 0 Answers

Find world position of a Texture2D 2 Answers

How to define a position local to an object? 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