[Activated!] New Part Physics API

Really excited for this! Can’t wait for January. Gonna try making some really cool stuff.

3 Likes

Yes, it may help to some extent but there are still issues with this approach. If you punch a wall, even though the wall never moved, you still applied a force to the wall and potentially could have broken it based on the material and structure. This is the same issue I have with damage detection, as it is near impossible to detect when forces are applied to the car in a dynamic environment (i.e. destruction derby), rather than when the car is reacting to hitting stationary objects or objects that are unmovable by the vehicle like swinging hammers. Take this example into consideration:

The car has little to no reaction to the impact force, when it should have taken more damage because of the force the car had on mine.

6 Likes

Why should we use :ApplyImpulse()/:ApplyAngularImpulse() instead of adding to the .AssemblyLinearVelocity?
Why is it called .AssemblyLinearVelocity instead of .AssemblyVelocity?

And also the :GetVelocityAtPosition(position), if the position is not inside the assembly does it return 0,0,0?

3 Likes
  • Better API: Avoids you having to manually do center of mass related calculations.

  • Better composability: If physics simulation / multiple scripts are applying impulses to the same object then it will always “just work”.

  • Better forwards compatibility: ApplyImpulse gives the engine a better idea what you’re actually trying to do, letting it give you better results (for instance, hard setting velocity / position may disrupt network interpolation where ApplyImpulse could potentially avoid that).

6 Likes

I have a question. If the engine is only applying a force to it for a single physics step and since the time in-between each step is inconsistent, doesn’t that mean the if you performed an impulse on the same object at varying times from startup, doesn’t that mean it would have inconsistent results?

1 Like

Happy New Year! This change is activated now, please report any issues here! I’ll follow up to latest questions in my next reply.

8 Likes

So, the inconsistent timing issue is something you could run into if you were trying to use a VectorForce as an impulse, by activating then disactivating it over 1 frame. I was trying to suggest how ApplyImpulse wouldn’t have this issue, it will consistently apply an impulse the first physics in-between step. Mentioning the “single physics step” probably made it more confusing. The reality is ApplyImpulse will give consistent results. If you call it more than once on a single frame, they will all be applied.

No, it will give you a linear velocity at that point in relation to the part’s assembly. (Note this API is not in this change, will be added in a few weeks)

3 Likes

one question.

why they jump?

wG8uMVWkv3

https://www.roblox.com/library/6209867165

i just made rods and...

19UQ0RT2nk

https://www.roblox.com/library/6209876853

accidentally threw plate 4x0.1x4 and it start speed up

thbPdkVDbo

simple part with size 4x0.1x4

why?

1 Like

This doesn’t look very good so far shouldn’t the entire physics engine changing be more heavily tested for simple issues like these before they do a

1 Like

Very exciting! Looking forward to it!

1 Like

then I think time will tell… right

1 Like

Can you elaborate on this? What is happening? What do you expect to happen?

Edit: I looked at the models you linked. As far as I can tell they don’t have anything to do with this change. Same results with it on and off. Can you post them in a support section with a more detailed question (feel free to tag me if you want my assistance)?

2 Likes

Hello, I am making this part knockback the player if they get too close using ApplyImpulse, but I notice that it only knocks them back if I jump, do you know why?

2 Likes

Hmm. I am very excited about the new AssemblyMass property because I thought it would save me from the inefficient method of looping through a model’s descendants and collecting the mass of each part. However, I have an rig with a number of constraints (notably CylindricalConstraints and SpringConstraints), and AssemblyMass actually gives a smaller value than my previous method of looping through everything.

I know that the mass I get when looping through the descendants is correct because if I add a VectorForce applying a force of mass * -gravity, it perfectly cancels out gravity. But, using AssemblyMass, it does not and instead slowly floats downward. Am I missing something? To be clear, all of the parts of the rig ARE attached to the root part that I am getting the AssemblyMass from, either with welds or constraints.

1 Like

Parts connected by non-rigid constraints are not part of the same assembly, so it sounds like you still have more than one assembly here:

(rigid joints refers to the Weld, ManualWeld, Snap, and Glue joints)
So things connected by Spring or Cylindrical Constraints are not the same assembly. Two parts connected by a spring can both have their own velocity, so they can’t be the same assembly.
Looping through the parts to calculate a total mass isn’t that inefficient, you should only have to do it once or whenever the collection of parts change.

This is an issue independent to Humanoids. They often change between simulated and non-simulated states. When they are in a non-simulated state, applying an impulse won’t work.
We are working on some changes that will fix this, leading to humanoids that are always simulated. Or, you can create your own character controller.

6 Likes

Ah ok that makes sense. In my case the masses of the assemblies attached with non-rigid joints are fixed so I can just cache that and add it to the assembly mass of the base root part to account for the changing mass of the main assembly. Nonetheless, this is a great and much anticipated update. Thank you!

Oke! I’ll do it, if i find time for it.

Yes, i just showed what i found for this month about roblox’s physic. Many of these things are speeding up and don’t want to stop.

How do we know if this is active in our games?

I really want to try this out in my physics based game.

It is live, and active in all games

all live game too? or is it a beta feature you have to enable?