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
-1
Question by midomido · Aug 14, 2013 at 03:37 AM · 2dphysicspointmotionpass

2d - calculating velocity needed to pass by point

Knowing the initial position and the point to reach position i need to find the velocity needed to pass by the point. i am not using rigid body object is only affected by gravity if someone could perhaps guide me in the right direction to fix this problem that would be great thanks. i need to calculate the minimum velocity possible that can pass by the "Point To Reach" as in the image. alt text

text3777.png (10.8 kB)
Comment
Add comment · Show 9
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 clunk47 · Aug 14, 2013 at 03:44 AM 0
Share

I don't know what you're problem actually is, you don't really state it. You don't have to have a specific velocity to pass a point... What are you even trying to do??? Are you using rigidbodies? Please be more descriptive, and we'll be happy to help.

avatar image midomido · Aug 14, 2013 at 03:55 AM 0
Share

sorry about that i edited my question.

avatar image midomido · Aug 14, 2013 at 03:57 AM 0
Share

i am currently going through this page trying to find something :- http://en.wikipedia.org/wiki/Projectile_motion

avatar image clunk47 · Aug 14, 2013 at 04:15 AM 0
Share

"i am not using rigid body object is only affected by gravity"

If an object is affected by gravity, it is a rigidbody.

avatar image clunk47 · Aug 14, 2013 at 04:23 AM 1
Share

You would pretty much need to test this out with different values, because you need to use AddForce depending on the current Gravity of your world. This would be a force you would only apply at the start. Here's a basic example of how to make an object "Jump". This would require a rigidbody component. Each method, variable, parameter I use here can be looked up on the Unity Script Reference, which will help you better understand.

 using UnityEngine;
 using System.Collections;
 
 [RequireComponent(typeof(Rigidbody))]
 
 public class Example : $$anonymous$$onoBehaviour
 {
     void Awake()
     {
         rigidbody.AddForce((Vector3.up + Vector3.right) * 5, Force$$anonymous$$ode.Impulse);
     }
 }
 
avatar image midomido clunk47 · Aug 14, 2013 at 04:28 AM 0
Share

you misunderstood my question - its my fault i am not really sure how to explain it very well. here is a similar question http://answers.unity3d.com/questions/398953/calculate-initial-velocity-to-reach-destination-ba.html but i dont have the Time variable so this cannot work for me.

Show more comments

1 Reply

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

Answer by Wuzseen · Aug 14, 2013 at 04:34 AM

This would be easier to calculate without rigidbodies--which you're apparently not using, so yay. You can simply do some interpolation along a 3 point hermite curve where Initial Position is the first control point, point to reach the second, and destination the third and final. You would then interpolate over this equation. It basically makes a function of a variable t with the domain t = 0 to 1. The result of this function is the position along your interpolation curve.

This is not a small amount of code, but it isn't actually that hard to implement: http://en.wikipedia.org/wiki/Cubic_Hermite_spline

The wikipedia article is terrible at explaining how to do it pro grammatically so I would suggest doing your own research. Like I said it's quite a bit of code--this is why things like iTween and what not exist.

EDIT: If you are simulating gravity with your own script, be sure to turn it off while you do this!

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 midomido · Aug 14, 2013 at 04:46 AM 0
Share

thank you for your answer the idea seem possible but i hoped for something as simple as shooting a projectile with the calculated velocity, i will use this with iTween path if i cant find anything more simple. thank you.

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

17 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

Related Questions

Finding the angle between 2 clicked points 2 Answers

Is there a solution to when colliders bypass? 2 Answers

Size and Position of BoxCollider 2 Answers

Lights that ignore position.z of GameObject 0 Answers

Need help on my script to calculate gravity for a mass 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