Moving and Rotating with CFrame without sliding

Basically, I am trying to make a ship go from one point to another, without sliding. Below is an example of what I mean.
image
Now, obviously this is math, but I would like some help figuring the math out, as I am not very good at it.
Would prefer implementation via CFrames. I am not asking for you to make the whole thing, just explain how I should go about it.

Edit: By the way, I do know how CFrames work.

Have you tried something like the slope formula?

You’re going to need to implement a series of points along a curve.

I am not great with math, however I know EgoMoose has a great tutorial on curves:

1 Like

There is also a good tutorial about Bezier curves in the Roblox wiki:

https://developer.roblox.com/articles/Bezier-curves

1 Like

This seems to work fine, if the ship is already generally facing the position it will move toward, however when it has it’s back toward it, it rotates at crazy fast speeds, which still looks unrealistic.
image

Haha this has ended up being an EgoMoose article thread. Everything posted so far has been written by me so hopefully if you have any questions I can answer them :laughing:

Anyways, in regards to your problem check out this post:

3 Likes

This is nice, but I am still having trouble rotating the ship correctly while it’s travelling across the curve.

Something you could try is using the Archimedes plugin to create 1/4 circles which will be the path of the ship. You could set the CFrame to each part of the 1/4 circle and set the orientation of the ship of the each of those parts.

Well you have some function which gives you a point on the curve, say f(x). Thus if you can use the CFrame constructor CFrame.new(origin, lookAt) in the form CFrame.new(f(x), f(x+0.001)) to get a CFrame that rotates with the curve

These are both great solutions, and I will definitely use a mix, however, @wevetments’ idea is perfect to make sure the ship turns in a realistic way, which was the biggest issue, so I will mark that as the solution.

1 Like