• 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 /
This question was closed Aug 03, 2014 at 12:22 AM by robertbu for the following reason:

Multiple issues

avatar image
Question by aman_jha · Aug 02, 2014 at 10:57 PM · c#androidjavascriptai

Flying AI Planes

Hey Unitarians,

Simple AI question here: How would I go about making planes? I only ask for the basic stuff. I want the plane to be able to target the player (I can handle that myself) I need the plane to always face and move in the direction of the player, and that's easy, but for three t$$anonymous$$ngs

  • If the player jet stops moving, I want the enemy plane to stop moving a certain distance away from the player, but continue shooting at the player

  • I want the jet to avoid the environment

  • I want the jet to only shoot at the player when it can actually see it, not when the player is protected by a piece of the environment

Does anyone have an idea on how to accomplish t$$anonymous$$s? I don't necessarily need a script just ideas on how to program it. Of course a script in c# would be nice :)

Thanks in advance, Aman Jha

Comment

People who like this

0 Show 2
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 robertbu · Aug 03, 2014 at 12:21 AM 0
Share

Unity Answers deals with single, specific technical questions. Usually I refer design questions to Unity Forums. But what you have here is multiple specific questions...which have been covered in part or in whole on Unity Answers multiple times. So I'm suggesting you break this question apart, do some research, if you get stuck on a single specific issue, post back with a new quetion on that issue.

Thoughts:

  • Getting the plane to stop a certain distance away is 'just code' and how you do it will depend on the effect you want. See Vector3.Distance().

  • Avoiding the environment has been covered many times. There are two basic approaches, raycasting and colliders. That is, you can use an oversized collider to make the plane appear to fly even if it is sliding across the ground. How well colliders works is in part defined by the nature of your terrain. Raycast solutions are typically done for racing games and enemy AIs, so look beyond planes for questions dealing with this subject.

  • Detecting when one object can see another has also been covered many times. Probably a Physics.Linecast() will be good enough for what I think you are doing, but searching will give your more complex approaches.

P.S. Questions with multiple issues are less likely to get answered since someone would need to know the answer to all of them to provide a complete answer.

avatar image aman_jha · Aug 03, 2014 at 01:15 AM 0
Share

Thanks robertbu! Those ideas are great and also, thank you for telling me about only posting one issue on here

0 Replies

  • Sort: 

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

23 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiplayer Support for Android 1 Answer

Test if object is within collider bounds on start 0 Answers

Touch Not Working 0 Answers

Things to do to port game made for iOS in Unity to Android? 2 Answers

Photon networking doesn't sync 0 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