[Activated!] New Part Physics API

When will the force application functions be available? And yes, this is wonderful for projectiles and vehicles where precise and accurate control of forces will be necessary. It would also be wonderful to be able to GET impulse data as well, useful in detecting things such as vehicle damage when either you collide with a wall, or a car collides into you. Both change the vehicles momentum but in different ways with different reactions, making it difficult to estimate just by checking changes in velocity. Would be great if like Touched, there was an event to get a contact point and the impulse force applied, along with the momentum of the object that collided so you could see if it was absorbed.

1 Like

Do you have an update for us yet?

2 Likes

I have a feeling that this may break some scripts that uses BasePart.(Rot)Velocity. Will using these legacy properties automatically set the newer properties?

EXAMPLE: Velocity will set AssemblyLinearVelocity and RotVelocity will set AssemblyAngularVelocity instead.

2 Likes

You’ll most likely have to manually go through your scripts and reconfigure them to this new operation. That’s the reason why the staff tells us about these things, so we can prepare our scripts for a future update the staff puts out.

Scripts will definitely be broken once BasePart.Velocity and BasePart.RotVelocity are fully deprecated, but I don’t think they’re going to be deprecated right after this release. (They’ll just have the status of ‘deprecating’ so other developers won’t utilize it anymore.)

They usually make a separate post talking about deprecating certain operations and functions from Lua, so I wouldn’t worry too much yet. But I would definitely keep an ear out.

I was corrected by one of the staff members that took the time to answer any questions or misconceptions so I’ll leave it to you to read their response.

1 Like

Unfortunately there were some unrelated issues with this weeks release, and I won’t be able to re-enable this feature. There are no more releases this year so we will need to wait until January. Thanks for your patience.

I’ll answer the latest questions about the new API in my next reply

9 Likes

Position is in world space!

Scripts will only be able to apply an impulse to parts that it owns. A client can only apply an impulse to parts owned by that client, you’d need to use RemoveEvent/Function otherwise.

This is an issue with humanoids, not the velocity properties. So applying an impulse will not make a difference in this case.
However, we will be solving this on the humanoid side next year.

No, anchored parts have no velocity. If you are updating its CFrame every frame, then you already know the “velocity”, it’s just the rate you are changing its position.

Yes this stuff would be nice, maybe one day :slight_smile:. The upcoming GetVelocityAtPosition function should help with a lot of this though.

No, this is not true. We would never cause old scripts to break by removing a frequently used property. Deprecation does not mean deleted, it just means there is a better replacement you should use for all future work. In this case, they will be hidden from the Property window and not show up in auto-complete.

15 Likes

Thank you for responding and correcting me. I just assumed that you guys wouldn’t go through all the trouble of doing that. I will edit my comment accordingly.

3 Likes

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