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 limdingwen · Feb 05, 2012 at 04:09 AM · aicrashwaypointwallracing

Strange AI

Hi all, I'm using a waypoint system for my racing AI, and am using triggers to determine if the racer has reahed a waypoint. The AI takes the position of the targeted waypoint and localizes the position. If the position of x is less than 0, it turns left; if it is more than 0, it turns right. However, sometimes the AI turns away from the waypoint without being hit or affected and crashes into the wall, and just stays there, and keeps going forward, even though the wall and it has zero friction (can turn along the wall) and the waypoint is just a few meters left from it. Sometimes, it turns but goes back the wrong way of the track. What can be done to solve this?

Many thanks!

Comment
Add comment
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

2 Replies

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

Answer by roamcel · Feb 05, 2012 at 07:57 AM

You are facing one of those problems that can be solved with infinite solutions ranging from one-line-simple to impossibly-complicated, so it can be difficult to pinpoint a cause for the issue.

Anyways, my guess is that the 'direction algorithm' you're using is only called upon the waypoint trigger, right? Whilst you should instead call it repeatedly over time to be sure that no external event misleads the ai and sends it forever into the wrong direction.

For that you could use the 'InvokeRepeating' function.

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 limdingwen · Feb 05, 2012 at 10:25 AM 0
Share

Thanks. It solved one of my problems but many of them are because of one careless mistake of leaving a gap, so some cars miss the trigger and thus go back, explaining the problem.

Thanks though. $$anonymous$$ay it come in handy in the future. ;) lol

avatar image
0

Answer by Kryptos · Feb 05, 2012 at 08:28 PM

Have you considered using UnitySteer (a porting of OpenSteer)? It has a Vector3PathWay defining a set of waypoints and a SteerForPath behaviour that can control your AI.

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 limdingwen · Feb 06, 2012 at 02:15 AM 0
Share

Hmm.... is it flexible?

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How To Add AI To Car/Racer? 4 Answers

Race Interfaces 0 Answers

"AI"/Behaviour for a Waypoint system 1 Answer

Ai turning problem on Android - Question solved 0 Answers

Waypoint System help 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