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 Ignant · Nov 28, 2012 at 06:33 AM · projectiletrajectoryarc

I want to find out how to make a projectile home in on a target with an "arc".

Basically, I want the projectile to go towards the target in an arc. If the player moves, it should follow them. So far, what I have is the projectile instantiating in front of the player and then going towards the target in a line (using transform.lookat and transform.translate). I have zero clue on where I should go from here.

alt text

Green is the player, red is the target.

shittypic.png (9.5 kB)
Comment
Add comment · Show 4
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 AlucardJay · Nov 28, 2012 at 07:16 AM 0
Share

If you use rigidbodies and physics, there are a couple of solutions here :

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

http://answers.unity3d.com/questions/248788/calculating-ball-trajectory-in-full-3d-world.html

avatar image Ignant · Nov 28, 2012 at 07:41 AM 0
Share

Great! These help me with the "arc" part. Now I just need to figure out how to combine both ideas.. thanks!

Ok, I played around with it and it's working a pretty well! I just used the same Transform.Translate/Transform.Lookat stuff I used before and modified the variables in them a bit. It's a bit wonky but acceptable. If anyone has a better way to do this, please show me, but otherwise, thanks alucardj!

avatar image Fattie · Nov 28, 2012 at 12:50 PM 0
Share

you need to learn about the physic engine champ, as ALU explains.

go to UnityGE$$anonymous$$S.com for a vast inrtoduction for beginners

avatar image Ignant · Nov 28, 2012 at 05:17 PM 1
Share

Sweet! Thanks for the website! I've got a lot to learn..

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Cygon4 · Nov 28, 2012 at 12:49 PM

There's a free library for Unity called "iTween" which can calculate splines, including ones that match a ballistic curve (and of course end with a picture-perfect landing on the desired spot).

The first example on its website might that already closely resemble what you're trying to do: http://itween.pixelplacement.com/examples.php

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

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

13 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

Related Questions

Aim preview for projectile trajectory 1 Answer

How do I arc a rigidbody so it lands on a target? 2 Answers

Arcing projectile using physics 0 Answers

help with shooting projectile along a curve path 1 Answer

Setting limits to my trajectory 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