Upcoming Potential Property Name Conflict: "Pivot"

Luckily I don’t name things on doors Pivot, I name them Hinge.

1 Like

For my project I very rarely need to access children. It’s usually faster to create instances proactively and keep Lua references to them, or come up with a custom ergonomic solution if needed. The bulk of my game’s code uses a custom module loader instead of traversing the game tree so I don’t really end up with game:GetService("ReplicatedStorage"):FindFirstChild("Modules"):FindFirstChild("Utility"):FindFirstChild("etc.") boilerplate.

It’s inevitable that new members/methods will be added to instances over time. The only way to keep your code stable long-term is to use FindFirstChild.

1 Like

Good thinking! Models are quite bare when it comes to functions and properties, adding more properties to models will improve efficiency as a developer. Easily pivoting around a point will help novices do more without having to know the technicality of it. :+1:

It is the most logical. You could have a “Children” property, but that would make chaining multiple children a mess. (parent.Children.ChildName.Children.ChildName.Children…)

Children should not be accessible as properties because they aren’t properties. This behavior makes no sense at all. To add onto that, since you can have multiple instances with same name under one parent, it isn’t very clear (logic-wise) what indexing does. FindFirstChild specifies that it goes over children and grabs the first with that name. WaitForChild specifies that it will wait until it finds one child with that name. The method names might be long, but they are descriptive and avoid errors entirely.

Then an update like this one comes and forces you to fix your code. That logic would work for any other engine, but Roblox forces updates.

3 Likes

Forearms aren’t even suppose to rotate that way. Its a bad habbit if your trying to do animation.

1 Like

I know, but it was the best example of showing how awful the rigging is on these default Roblox models. Thanks for the tip tho.

Looking forward to this, it will be a great feature to have, I can already think of a few things that can me made with pivot locations. such as doors, and of course custom characters/rigs. Would also be nice to have it linked to the rotation tool, so you can pick a position on the part to rotate it, instead of rotating it from the centre of the part. I know there are some building plug ins that you can do this with, but I prefer to use the Studio built in tools for building, so seeing this is great.

NO. WAY. WE FINALLY HAVE PIVOT POINTS? I am ECSTATIC. I assume this will work with the .obj and .fbx importers?

My one issue with FindFirstChild is, in some cases you will no longer have access to the info about the item with autocompletion, while you would using a direct reference. Pretty important for parts that are heavily and regularly affected by scripts, like let’s say, a humanoid.

Edit to add: A good practice I found however to still have this added layer of safety (FindFirstChild) is to work without it to have all the shortcuts, then when I’m done, add the function.

2 Likes

That will be a game changer. If am right then this change will allow us to do the complex math of CFrames visually.
Like the parent-child relationship in Unity or Godot. Where the child’s movement is relative to the parent. Which makes FPS games tons easier than roblox raw cframe operations.

For example:
Godot’s Spatial Object:
https://docs.godotengine.org/en/stable/classes/class_spatial.html

LPT: You have options for replace. Use them. You should be searching for whole words, so the PivotPoint will stay as PivotPoint and Pivot will be :FindFirstChild("Pivot")!

You can’t use the whole word search in all cases though. For example :Pivot() vs .Pivot. (It also won’t work if your search contains symbols, since symbols break up the words) On top of that, you don’t always want to replace content inside of strings, and, its extremely hard to avoid that. "Pivot" acts as a whole word match, same with "something Pivot something". Generally I avoid the whole word search if possible because it gives me more information on exactly what I’m replacing. I am aware that the whole word search exists, but, its not always ideal to use it, I almost never do (plus, its not harder to put a . at the beginning, it makes sure you’re avoiding as many undesirable cases as possible).

Updated planned rollout date to February 24th March 10th.

8 Likes

Are we going to be able to give feedback before this goes live? It seems like a pretty big change.

1 Like

There will be a part of the beta period where the feature will only be enabled locally where we’ll still be open to API feedback / changes.

1 Like

Update on this, it ended up taking a while, but we finally have a concrete date that this will be going live: March 17th (the properties showing up in the Lua API at least, the actual beta feature will come later).

The property naming has changed, we will no longer be using “Pivot”: Instead, the properties being added are “Model::WorldPivot” and “BasePart::PivotOffset”, which are much less likely to have any name collisions.

8 Likes

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