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 BilboStabbins · Aug 08, 2012 at 04:52 PM · waypointsplinepathfollowingbezier

Recommendations for a script/plugin for creating set, curved paths

Hello all,

I would like to create paths for my enemies and would like the paths to be as smooth as possible. No AI is involved at the moment - I would just like to be able create various curved paths for them to follow. I've tried a few waypoint scripts but they require a large number of empties for anything that looks smooth.

Therefore, I am looking into alternatives. There are a number of spline/bezier path creating plugins on the Asset so I wanted to get a few recommendations if possible. Also, if there are any scripts that you know of that can make this task easier then please let me know. Unfortunately, iTween is out as it's paths cannot be parented to an object/prefab.

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
1

Answer by ScroodgeM · Aug 08, 2012 at 09:50 PM

this answers can looks crap and unuseful, but works very fine in one of my projects 8)

if you have set of values and need smooth moving between them even at both sides of value (so where before smoothly goes to after), you can use programmaticaly creating animationCurve. setting keys to it will make a smooth graph of moving via these keys.

look below - input data is set of numbers 3,10,15,0,20,12,5

output data is smoothed line that intersects all these points. (see pic). this created programmaticaly at runtime.

can be used as well for vectors (separately for coordinate components) and results in smooth path using only main checkpoints.

Smoother.cs

using UnityEngine;
using System.Collections;
public class Smoother : MonoBehaviour
{
    public int[] CheckPoints;
    public AnimationCurve c;
    void Start()
    {
        Keyframe[] kf = new Keyframe[CheckPoints.Length];
        for (int i = 0; i < CheckPoints.Length; i++)
        {
            kf[i] = new Keyframe(i, CheckPoints[i]);
        }
        c = new AnimationCurve(kf);
        for (int i = 0; i < CheckPoints.Length; i++)
        {
            c.SmoothTangents(i, 0.5f);
        }
    }
}

alt text


1.png (14.3 kB)
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 Dragonlance · Aug 08, 2012 at 09:56 PM 0
Share

That sounds good! Very nice idea to use AnimationCurve for movement by code.

avatar image
0

Answer by wondersonic · Aug 21, 2012 at 03:05 PM

Eventually, try iTween (google it) plugin with a path editor.

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

11 People are following this question.

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

Related Questions

Problem with moving through waypoint 0 Answers

draw curved line between waypoints - like ongizmodrawline? 2 Answers

Best way to have vehicles follow a path? 2 Answers

Generating a Flat Mesh from Spline/Bezier Curve? 1 Answer

Bezier Path considering external forces 2 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