But this jerks too much, as the camera and model both change direction instantly at each point. What I really need though, is something more like this:
If anyone here has a simple system which can tell an object where it should be in this sort of lerping system (4 parts), or can tell me how to go about making a simple one, I’d greatly appreciate it!
That helps a lot! I’m not entirely sure how to utilize this code, though. I have a localscript and a module, the localscript containing this:
and the module script containing the 2nd to last large code snip (for the module) towards the end of that wiki article.
Do I go through a loop of 0 to 1 (for t) for each part in my curve table, and position the camera/model with what it returns?
Natural splines are harder to pull off but they give the smoothest possible curves, i.e. minimizing the square of acceleration. The solution for n points is a pain to implement, but there might actually be a nice solution for just 4 points.
It’s not officially deprecated yet, as there is no replacement. But it will be when the new Lua camera controllers ship in 2018 with interpolation incorporated. He’s giving you an early heads up. Camera:Pan and Camera:Tilt will also be removed as C++ API calls, replaced with Lua code. Camera:Roll will be supported a bit longer, on account of it being more widely used. There is simply no reason to have camera control code partly in C++, partly in Lua. We want it all in Lua. My end goal is for the C++ Camera object to be little more than a CFrame and FieldOfView.
Not speaking for Roblox, but avoid using Interpolate for new work. Use TweenService instead.
Do note that you cannot tween a model. I’ve run in to this problem a few times. You either have to use lerp (which looks framey IMO) or some sort of bodymover.
I’ve been messing around with the code, but I can’t quite figure out what exactly I’m supposed to hand to the “travelPath” function inside my script. Currently, I have a local script which looks like this:
and a module script inside of it which looks like this
Does anyone know how to properly use travelPath? The wiki explains it a little but it gets confusing about halfway through the article.