LinearVelocity unexpected behavior

While creating a guided missile, directly moving towards a target (so no proportional navigation, just basic stuff), I discovered that using the exact same code the deprecated “BodyVelocity” and the new “LinearVelocity” behave differently.
This code sets a new velocity every frame pointing to the target from the missile.
While getting near to the target from behind (due to the following nature, this is normal behavior for this missile), LinearVelocity stops working and often seems to ‘bounce’ back from the target and thus never reaching the target. This can often be prevented when the velocity difference between the rockets is larger, but that’s both a bit unpredictable and feels like a bad fix.

I find it hard to describe the issue into words, but I added a video below that shows the issue (first showing the working, deprecated asset, then using the new asset).

robloxapp-20240215-1111067.wmv (2.1 MB)

Also, here is a proper testing place where the issue is recreated.
GuidedMissile.rbxl (101.5 KB)
Sidenotes:
When using LinearVelocity, I employ a BodyForce (deprecated) to counteract the gravity. The bug I describe may very well have to do with using this item in combination with the LinearVelocity, but the rocket does not function at all without it (just dropping due to the gravity).
I do not like the .Touched event, so I detect whether the rocket reached the target with a .Magnitude check. The bug I describe also occurs when using the .Touched event.

To test the bug I describe in the attached place, you can just play, use the item in the backback and switch between the modes using the only GUI button visible. Only one rocket can fly at a time and firing works using a single click on any BasePart. A single horizontally moving part can be found, just as three stationary parts.

I hope you can look into this, I’ve not seen much discussion on LinearVelocity on the web in general, and nothing describing this specific issue.
If you need any more information I’m happy to oblige!

1 Like

We’ve filed a ticket into our internal database for this issue and will start investigating, we will update you when we have further information.

Thanks for flagging!

3 Likes

This might be causing instabilities, Body Movers and the new constraints don’t work well together. Haven’t tested this, but using a VectorForce relative to the world should be able to counteract gravity. I feel like the mix of physics movers might be causing the bounce-back.

3 Likes

GuidedMissile.rbxl (101.7 KB)
Here’s an updated version of the place showing that the interaction of the different movers is indeed the problem. I replaced the BodyForce with a VectorForce and it behaves as expected. Since BodyForce is deprecated, I think it’s fine to close this bug. There might be something going on in the background that could be interesting to look at further, but not a high chance.
Apologies for the inconveniences caused.

2 Likes

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