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

Multiple issues

avatar image
0
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 things

  • 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 this? 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
Add comment · 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: 

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

How to create an 3d game object in 300 X 250 size? 1 Answer

What should i learn for unity C# or UnityScript? 4 Answers

How to set angle for a object to 50 degrees? 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