Fetching a tool's orientation

Is it possible to fetch the orientation of a mesh? I’m trying to create a 3D backpack however some of Roblox’s sword meshes seem to be uploaded in a different orientation of others so it doesn’t look too uniform right now. Here’s an example:

I’m thinking that since I’m loading them from their ID on the catalog I can maybe figure out how to rotate them based on their tool grip, but i’m not exactly sure how tool grips work. Any help would be great appreciated! :smiley:

Did you try looking through any of these before posting? Preferably this one in particular.

That does not contain any sort of solution unfortunately.

That’s a shame, what about this plugin?

To make this more clear, I know how to fetch the tools’ grips. I just am not sure how I can use that grip to create a formula to make sure they’re all facing upright instead of some of them being sideways.

It’s possible to ‘assign’ which face is up for the meshpart for each of all these tools. If that happens you have to use a table, assigning them into these options:

  • X or -X
  • Y or -Y
  • Z or -Z

…and it probably needs to be rotated properly.

Meshes don’t have original orientations data. When they’re uploaded, they are as they are with made faces up, left, right, down, front and back.

Alternative options would be custom meshes. Unfortunately, that solution would be redundant as you are reuploading Roblox’s sword meshes again. So CFraming it should be the only solution without having to re-invent the wheel.

Might be ineffective, but that’s the current knowledge I could find from experience.

My thoughts were that the Tool Grips make all tools equip in the same orientation so maybe i could somehow use that standard to rotate them all to one standardized rotation and then go from there. I tried setting all of the parts’ rotations to their Tool Grips’ rotations however they still aren’t all in sync.

1 Like

Did you try resetting the polygon axis in the modeling program you use?

I’m trying to do this in Roblox through scripting, not a modeling program.

No, you cannot retrieve the orientation of a mesh. You can only retrieve properties as they relate to the BasePart in use. The closest you can get is Size and Position of MeshParts but even then, those are not guaranteed to be in the numbers that you expect.

Hi, thanks for the reply. I actually just finished figuring it out. I’m sure there’s a way to use the tool grip data to get all of the tools in the same orientation but I’m by no means a math genius so my way to get them all aligned was to Equip each one to a local dummy model & then grab their CFrame rotational data :smiley:

2 Likes

Using properties of a Tool is not the same as trying to fetch data from a Mesh, so your post title and content is fairly misleading and inaccurate. Please correct it and try to have a degree of accuracy in your threads in the future.

There is no direct way to retrieve mesh data from a mesh in Roblox aside from the BasePart it resides on. As far as displaying a Tool object goes, feel free to use the Tool’s Grip as a CFrame reference for rotation off of a specific point. I personally would just weld each Handle to an invisible root so that I can get the rotation I want without bothering with CFrames (I hate working with them).