Fast Moving Object Glitches When Touching The Edge of Two Touching Platforms

The topic pretty much says it all.
I have a an object traveling straight at a velocity of 100 on a flat platform.
I added body gyro to prevent the part from flipping (but allows rotation) by applying the force mainly on x and z.
Due to the fact that parts in Roblox does not allow parts to have a side length longer than 2048, I had two connect two parts to extend the platform.
However, when my object is traveling to the connecting part of the platform (which has no gap) sometimes the object rotates and even glitch up into the air.
Is there anyway I can prevent this glitch?

1 Like

How about a PrismaticConstraint for the movement? I just checked and am able to make it have limits of 10000 and -10000 so far without issues. Just put another Part on top of the sliding Part and have a HingeConstraint on between them.
I don’t think a SlidingBallConstraint is what you need since that would pivot around the axis of the slide, not 90 degrees to it.

1 Like

Well, the thing is this object rotates using keys a and d. So I have to allow the rotation. (It is a hovercraft)

You can use the A and D inputs to rotate the HingeConstraint as well.

1 Like

It will be no use then since it still rotates. Also, my hover craft is going to climb hills so…

So the hovercraft model has parts which are actually touching the platform parts? If they are not touching, then ignore my post…

If the parts are touching, I wonder if there is some physics engine impact between the 2 platform components that could maybe resolve with a NoCollisionConstraint between platform A and B?

If the hovercraft parts were actually floating on top of the platform parts, then I would expect you to get around the glitch you experienced. Maybe with a BodyGyro + BodyForce or BodyThrust for the Y direction / hovering might also work.

What you’re working on sounds pretty cool in any case!

1 Like

The way it floats is by having an invisible block below the actual hovercraft, but the invisible block glitches with the edges. If I use the nocollisionconstraint it is going to make it fall through the road.

Got it. Thanks for the clarity. This is indeed tricky.

It might be worth trying doing a NoCollision constraint between the 2 platforms themselves (not involving the actual hovercraft). It might be the case that the physics can be resolved that way.

Obviously, I don’t know much context about your game. I still am a fan of using BodyForce to create lift for the hovercraft versus rolling on the platform. But this depends on many things and it has a different set of benefits and challenges.

I included an example of what I did to quickly test it out. It’s a base with 4 welded engines, each engine has BodyGyro, BodyThrust, and BodyPosition. The BodyPosition is only set in the Y axis for lift, and I have a significant dampening factor (.D) to control it. The BodyForce is set in the Y axis giving it additional lift, just enough to levitate mostly.

You could use BodyPosition in different ways. You could use raycasting to determine the terrain or part elevation and update the BodyPosition.Position.Y value accordingly. You can also have it move you to any X,Z target too, provided you have careful dampening ad/or you use a loop to occasionally update the target x,z coordinates incrementally towards a target based on your steering system.

image

2 Likes

The primary reason why I have a transparent block under the hovercraft to make it “hover” is because lifting is complex due the fact that my road has up and down hills and left right tilt. I will first try to have the no collision constraint between road parts and see if that will work. If not, I should probably try to figure out how lift can be applied to my game.

Ok, cool. That does make it extra tricky. Please do report back on what you find out.

In my experimenting, I found that the physics lift approach has many options, each with their own pros and cons. Things like BodyPosition are helpful in smoothing the ride regardless of the terrain or ground underneath (or at least somewhat, depending on your settings).

But the thrust forces let you “ride” the terrain more closely, which is good but can lead to loss of control. In this case, you might need invisible regions by the road to act as barriers and you might need to use Collision Groups to make them work on the hovercraft but nothing else.

You have a really interesting scenario though, and I look forward to checking it out when it’s resolved and shipping!

1 Like