Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
-1
Question by shadowseve · May 10, 2010 at 04:08 PM · waypoint

question on using waypoints and an arrow to guide a player.

OK so in an effort to guide the player through this huge level I built. I built an arrow in 3ds max and set it to look at and point towards an empty game object. How can I get it to "point" to the next way point once the player reaches it. I need to guide the player towards a temple and using the arrow seems like the best way. I originally had it looking at the temple, however, it would lead the character over mountains that they can't climb. so I figured by setting several empty game objects as "way point" I could move the player in the right direction, but once you reach a way point I can't get it to move on to the next one.

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

Answer by jester · May 10, 2010 at 04:24 PM

You could put the empty gameobjects in an ordered list and everytime the player gets to an arrow, iterate to the next arrow in your list.

Comment
Add comment · Show 3 · 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 shadowseve · May 10, 2010 at 04:34 PM 0
Share

yeah that's what I was thinking, but how do you code that. All I have right now is the arrow pointing to the game object via the default smooth look at script. I'm definitely not a coder.

avatar image shadowseve · May 10, 2010 at 04:45 PM 0
Share

Basically I need 3 way points to achieve what I want. Say I name the objects waypoint01 waypoint02 and waypoint03. how would I implement that via code.

avatar image jester · May 15, 2010 at 05:05 PM 0
Share

sorry about not replying sooner. i've been distracted by my non-game coding day job. glen has the right setup below for the array of waypoints. as for implementing a switch between them, you could have a trigger on each waypoint and a number for it's array position. every time a waypoints trigger is hit, use that number + 1 for setting the arrow to point to the next waypoint from the array. that waay, if a player somehow missed a waypoint and got to the next one, it would still point them to the next one in the array and they wouldn't get out of order or anything.

avatar image
0

Answer by glewis · May 10, 2010 at 05:00 PM

How about something like this?

private var waypoints : Array;

function Start() { waypoints = new Array(); waypoints.length = 3;

 var waypoint1 = GameObject.Find("Waypoint1");
 var waypoint2 = GameObject.Find("Waypoint2");
 var waypoint3 = GameObject.Find("Waypoint3");

 waypoints[0] = waypoint1;
 waypoints[1] = waypoint2;
 waypoints[2] = waypoint3;

}

-- Glenn

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 shadowseve · May 10, 2010 at 05:23 PM 0
Share

That might just work. Will try it out tonight and report back if it works or not. thanks.

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

1 Person is following this question.

avatar image

Related Questions

Problem with NPC rotating around a waypoint 3 Answers

audio for moving platforms 1 Answer

Waypoint problem 2 Answers

GameObject rolls towards Waypoint 2 Answers

Pathfinding 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