Our physics team has been working tirelessly to enhance the usability of our physics engine and its features. Today, we are excited to give you a sneak peek at the first batch of improvements that are centered around Mover Constraints.
Let’s dive in!
1. Limit AlignPosition and LinearVelocity Max Forces per Axes
You can now define the maximum amount of force applied in each axis using a Vector3 for the AlignPosition and LinearVelocity mover constraints. This empowers you to design more custom behavior and should enable you to fully replace all BodyMovers with mover constraints. You can read more about this new capability here.
2. New LookAt Mode for AlignOrientation
We are adding a new AlignOrientation mode called LookAt which forces the primary axis of your first attachment (Attachment0) to always point towards the second attachment (Attachment1). This makes it a lot easier to add things such as motion tracking security cameras or guided missiles. You can find more information about AlignOrientation and all its modes here!
AlignOrientation is getting a user interface refresh. We’re simplifying the process of selecting between modes by removing the boolean-based approach for the two single axis modes (parallel and perpendicular). Instead, we are introducing all three previous modes (AllAxes, PrimaryAxisParallel, and PrimaryAxisPerpendicular) along with the new LookAt mode directly under the AlignType enum. The default mode will remain “AllAxes” to maintain consistency.
Looking ahead, we have an exciting roadmap of features planned:
Force visualization for all forces and torques to aid in debugging physics issues.
Access to additional mass properties like Moment of Inertia.
Visualizing mass properties such as the Center of Mass and Moment of Inertia.
And many more enhancements to make our physics engine even easier to use.
We value your feedback and suggestions! We want to ensure that we are addressing your needs and continuously improving our physics engine. So please let us know what you think about the upcoming improvements and share any ideas or requests you have for making the engine even better.
How can I make AlignPosition maintain a constant velocity and not apply force on the Y axis? MaxAxesForce I thought it would be a unit vector that would multiply itself with the MaxVelocity given. However, it has these big numbers 10000, 10000, 10000 which are hard to manipulate unless I get the right formula to get a constant speed between the origin and the goal without the object starting slow or slowing down at the end.
This’ll be a lot of fun to work with! I can already see many great use cases for camera-work using AlignOrientation constraints. Sounds like this opens a good amount of extra room for cutscene ideas as well.
Can’t wait for those additional mass properties to be introduced too
Will we get access to run code every physics step?
What I mean by this is to either get access to the 240 hz “loop” that is used by the built-in physics or get access to a reliable version of the RunService.Stepped event that doesn’t directly change based on framerate.
It’s very difficult to create a character floating force (or something of the sort) with the current stepped event because the stepped event is directly tied to framerate
This means that if the framerate is, for example, 5, the character floating force only updates 5 times per second. This causes the force to get super bouncy and out of control.
The given example can be seen in the game Road To Gramby’s, where if your framerate gets too low, you are prone to bouncing out of control. This is because (to my knowledge) Road To Gramby’s uses a custom floating force for characters.
If anybody wants to test this, mess around in a free private server. I’d say spawning a ton of objects will do it.
Adding this would be a nice usability improvement I’d say.
Looking forward to the Moment of Inertia property - a game I work on allows players to build massive spacecraft, and we regularly encounter an issue we refer to as “mass locking”, which we believe is where moment of inertia exceeds some internal value and prevents the ship from ever turning. I can provide a reproduction place, it’d be nice if this could be looked into - it’s the only thing stopping us from allowing players to build bigger lol
Love the changes for usability that enable nice shortcuts! Makes the objects feel extremely robust and intuitive.
Has the team ever considered doing some form of demo-tutorial in video/docpage/rbxl form? For example, Speedtree does this on their Youtube channel (a series where they make some common foliage types in the tool to showcase the functionality).
I feel like it’d be super helpful especially for new devs to see curated guides on some common applications that these objects might be used for, since even user-generated content on this, especially on new objects, is a bit scarce, and I’ve always found it pretty challenging to give any developers learning the engine for the first time a “starting point”.