This forum is currently in read-only mode.
  • A simple example of how to do paths.

    The little scribbly thing goes through every waypoint, ordered by their index.

    It has a private variable that tells it where to start (gets modified in runtime)

    Waypoints have a private variable that tells its order (index).

    You can have more than one instance of the sprite following the path at different points, just set the appropiate starting point in 'current'.

    I was aiming for cubic interpolation, then I realized what I really needed was splines. That'd be useful. Maybe I'll try it some other day.

  • Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Smooth waypoints!

    had to put in the formula for cubic, as the built-in cubic doesn't go through the control points.

    Used the formula verbatim from http://local.wasp.uwa.edu.au/~pbourke/m ... rpolation/

    It was suggested that a Hermite (http://www.cubic.org/docs/hermite.htm) would be a better fit.

    As of now, speed is constant in each segment, which means there's a jump to the new speed on a segment jump.

    Usage: set waypoint objects, set their PV index and time to reach from the previous waypoint. They're traversed incrementally 1 by one. Set the follower's sprite to the first point to be reached, there have to be at least 2 previous points from that one for the curve to do it's thing.

    Toggle the make invisible action at the beginning of the sheet if you don't want to see the waypoints.

    With help from Mipey.

  • And here is my version, using cubic interpolation. The red dots are tangents (vectors from the waypoints based on angles).

    I have yet to figure out how to make it move with constant speed!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)