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
0
Question by Hellwalker · Apr 01, 2010 at 10:52 AM · pathfindingwaypointsteering

object following a path, like train - railroad

Hi, what techniques can I use to make object follow a path? something like a train following railroad.

it must be able to follow strait lines, and curves as well.
speed by which gameobject will move will not be constant, it might accelerate or slow down.

I'm new to unity and don't know how to approach this.

only solutions I could think of were 1: animating path in 3d program, but then how do set speed in realtime? 2: adding kind of pinpoint objects, my car or whatever will move towards. but will it be possible to get exact form of path object this way? I could add pinpoints at the same locations where vertexes are on path object, basically a turning points of curve. but is there any function that can track in realtime which pinpoint is next and function that can calculate curve between last and next pinpoint?

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

4 Replies

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

Answer by Hellwalker · Apr 28, 2010 at 07:04 PM

http://www.unifycommunity.com/wiki/index.php?title=Spline_Controller

was the best easy solution I found, but speed and rotation proved tricky

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 Good_Rabbi · May 27, 2015 at 04:09 AM 0
Share

Link is broken... Any other links to that content?

avatar image Ralff · Jun 22, 2015 at 12:02 AM 0
Share

Stuff got moved. Here is the updated link: http://wiki.unity3d.com/index.php?title=Spline_Controller

avatar image
1

Answer by efge · Apr 01, 2010 at 12:40 PM

I would suggest solution 1 because when you want a train follow a railroad track you need the exact position and rotation of the individual objects.

Reference for Animation Curves

For changing the velocity there might be 3 solutions:
1. You could also use an animation curve.
2. Set Animation Events for specific frames. (also useful for signals or speed limits at stations)
3. Calculate the velocity depending on the pitch and roll of your game object.

Waypoint/Bezier examples can be found in the Unity forum.

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 Hellwalker · Apr 01, 2010 at 01:10 PM 0
Share

I used railroad example, but my actual gameIdea is bit different.

I want to make curved track in 3d program, and I want gameobject to follow its path constantly, speed might change when player hits button or runs over some gameobject, kind of speedboost.

I will look into your links, thanks

avatar image
0

Answer by Ricardo · Apr 01, 2010 at 11:09 AM

You want to look into:

  • Pathfinding
  • Steering
  • Waypoints

Those topics will cover what you want to accomplish. Unity doesn't give a solution for any of these out of the box, but there are several available online. Read up on the articles for the tags I added to your question.

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 tyados · Apr 18, 2014 at 07:00 PM

I also came across curvy from fluffyunderware or something. I didn't try it yet but seems promising. iTween also seems to deliver something in regards of path finding, but the demos that i saw wasn't that "curve-y". I'll try a bit more and maybe update this answer.

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

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

Help with a simple AI 2 Answers

Pathfinding over a dynamically deforming mesh 0 Answers

How do I add more waypoints to a moving platform script. 1 Answer

Avoidance Behaviour 2 Answers

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