• 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 GroundHOG-2010 · Nov 25, 2010 at 09:00 PM · aicarnavigationwaypoint

How to make waypoints

Hi In the game were making we need to know how to make way points in unity. The only problem is that were all noobs and don't know how to. Please help.

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

8 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Program4Life · Jul 31, 2013 at 08:48 PM

Hey guys...my first post WOOT WOOT! I just figured out today how to make AI rotate towards waypoint, So I will share with you guys. Just add:

transform.LookAt(waypoint[currentWaypoint]);

Under where you declare the variables in the first if statement.

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

Answer by Kaha · Jan 20, 2013 at 07:32 PM

Hi,

How can I make a loop in the waypoints Transform ?

Right now the Enemy is doing: 0>1>2>3>4>5 And I'd like him to do: 0>1>2>3>4>5>0 and continue looping.

Any idea ?

Comment
Add comment · Show 2 · 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 Kaha · Jan 20, 2013 at 10:16 PM 0
Share

If done the loop using this tutorials : http://www.youtube.com/watch?v=-5Ri$$anonymous$$oILHTA

avatar image programmrzinc · Feb 08, 2013 at 02:35 AM 0
Share
 if ( currentWaypoint >= waypoints.length ) {
     currentWaypoint = 0;
 }
avatar image
-1

Answer by Tuben · Sep 12, 2012 at 09:54 PM

Hey is it possible too add somthing too this script so the enemy/npc turn(rotate) too the next waypoint? mine is currently only sliding too the next one. thanks!

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

Answer by Tuben · Sep 12, 2012 at 09:54 PM

Hey! is there anything i can add too this script so my enemy/npc turns(rotates) too the next waypoint at the moment he only slide the wrong way to the next way point. Thanks!

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

Answer by devilkkw · Jul 18, 2011 at 08:21 PM

just replace rigidbody.velocity = velocity;

in rigidbody.velocity = speed;

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 shopguy · Jan 27, 2013 at 03:24 AM 0
Share

This is incorrect, please see the comment I left on that answer -- line just needs to move up a bit. If you used speed, object would move at the same speed, same direction/etc.. would not head towards waypoint at all.

  • 1
  • 2
  • ›

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.

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

8 People are following this question.

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

Related Questions

Cars in City 0 Answers

Check whether car has passed a point in world space 1 Answer

How To Add AI To Car/Racer? 4 Answers

Car- can someone help me convert this to C#? 1 Answer

Steering an AI vehicle to a waypoint using float of -1 to 1? 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