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 devilsid · Jan 12, 2015 at 04:46 PM · navmeshnav

Custom AI issue

Hello,

I have created a custom AI for enemy which follows the player when it looks at the player. I am using Raycast for the above functionality. It works fine but when the player is behind the wall or some object then the enemy stops following the player which is obvious because the enemy cannot see the player.

So is there any way I can make the enemy follow the player.

Or is it better to use the Unity Navmesh agent. But my game enviornment is large with bumps, walls, building with lot of other things. Is there any performance issue if I use Unity Navmesh Agent instead of my custom AI script.

Any suggestion, help will be appreciated.

Thanks

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 nu-assets · Jan 12, 2015 at 05:03 PM 0
Share

The Unity Navmesh is pretty optimized, so you can of course use it. But if you have alto of 'followers' I would recommend limiting the the Navmesh following to a certain area/distance around the player.

But to follow your initial approach (for what reason ever):

You could put your target (player) on Layer (e.g. PlayerLayer) and raycast only against the specified Layer. When doing so, your enemy does not stop following when in front of road sign or what ever. But you will come across some situations this kind of AI is looking pretty bad (As you said: when there's a wall in front). :)

avatar image devilsid nu-assets · Jan 13, 2015 at 06:20 AM 0
Share

Hi,

I was looking at Angry Bots project in unity which I think is also not using the Unity Navmesh and are using custom AI script to follow the player so I thought that navmesh causes performance issue.

Next about my AI script, when it sees the player it follows the player but when my player is behind the wall it stops following him because ray from enemy cannot hit the player. But the main point is can I make the enemy make its own path like unity navmesh agent.

or maybe I should use Unity Navmesh and modify it as per my needs.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Nav mesh agent position 1 Answer

NavMeshAgent not crossing over certain tiles 0 Answers

when I add a navmeshagent to an object and start the game, the object is moved ,anyone know why? 0 Answers

can Not open Window > Navigation 2018.2 1 Answer

How would I simulate a rectangular Nav Mesh Agent? 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