Rocket stuck circling around target

TL;DR: Rocket can get stuck circling around target. Help.

Hey there!

I’ve been working on making a rocket launcher, with the help of this post.
Instead of flying in a straight line to the target, I have the rocket initially fly straight out of the barrel and then curve toward the target.

Consequentially, it can get stuck flying around the target if it does not have enough time to turn towards it.

Example of rocket flying around target

Note that I’m using a LinearVelocity to make the rocket fly, and an AlignOrientation to make it curve toward the target.

I’ve tried:

  • Reading docs and searching forums

  • Increasing and decreasing AlignOrientation’s MaxAngularVelocity, MaxTorque, and Responsiveness
    Higher values help to a certain extent. Again, I want it to curve. There is a limit to how high I can set them before the rocket snaps to it’s target orientation and then flies in a straight line.

  • Increasing and decreasing LinearVelocity’s VectorVelocity
    Lower values give the rocket more time to turn, but there is such a thing as too slow.

  • Using magnitude to implement the distance between the rocket and target into the turn speed

I’m really stuck on this one and would appreciate any help.
Let me know if you want any of the scripts.

2 Likes

I’d need a bit more info to be sure of whats wrong, does the rocket continuously orbit the player and does it even face them? And how far from the player is it usually orbiting?

1 Like

You might try linearly/quadratically changing the Responsiveness or other parameters of the AlignOrientation the closer it is to the target. That’s all I can really think of besides making it CFrame based and calculating all of it with math.

1 Like

It continuously orbits the player. The distance from the player can depend on the angle and distance to player the rocket was fired at.

Here’s a video. Sorry about the quality, I don’t have a recording software so I’m just using roblox’s built-in recorder.
robloxapp-20230630-2117233.wmv (2.5 MB)

Apologies for the delayed response. I’ve been trying this and it’s been working very well, thank you for your help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.