Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Can I make a segmented model consistently curve along an arc flight path?

Asked by
Xetrax 85
9 years ago

There is no code below, this is simply a question I am hoping to get a good answer, or at least a few opinions on. I want to make a rocket that when fired, calculates the distance to its target and draws an arced flight path, as it flies, it curves to the said arc path which would produce a realistic rocket in flight. (Note: I'm not actually going for a rocket, and I don't want to use bodyvelocity/rocketpropulsion/angularbodyvelocity/etc. objects, just CFrame ** manipulation. What I am going for is a part(0.4 x 0.2 x 0.4) connected to another part by a **weld, and I want them both to curve along the path(by manipulating both the weld's C1 and the front part's CFrame), thanks if you can help.)

0
Well, it bolded that sentence wrong, but whatevs, its still readable. Xetrax 85 — 9y
0
Lol, -1 Points, idk why, this IS a valid question, isn't it? Xetrax 85 — 9y
0
Although I didn't -1 the question, some people may not appreciate the fact that no attempt was even made at this. People get pretty upset when they see the words 'I want', 'I want', 'I want'. It makes them think you want us to do all the work. I'll upvote you back, but remember my advice for next time. DigitalVeer 1473 — 9y
0
Oh, sorry, its just a question I had at the time, as I was working on many things at the same time and I didn't have the time to get started on the code, I'm sorry if anyone took it the wrong way. Xetrax 85 — 8y

1 answer

Log in to vote
1
Answered by 9 years ago

Certainly. You need either a formula that represents the position given the time since the rocket launched or an algorithm that advances the rocket based on how much time has passed since the last update. You could draw the path using a series of small bricks (you could have more space in between parts if you connected them with FloorWire and made the parts themselves invisible, though in my limited testing with it I found FloorWire to be unreliable); these bricks would use the same function(s) as the rocket to position themselves.

For the smoothest possible animation, consider using RunService; if you give it a function, ex "UpdateRocket", it'll call that function up to 60x a second, which is ~2x as frequently as if you used a while loop with "wait"s in it.

0
Thanks, this gives me an Idea to get started. Xetrax 85 — 8y
Ad

Answer this question