Allow DoubleSided to be changed by scripts

As a Roblox developer, it is currently impossible to change a MeshPart’s DoubleSided property in-game because the property is designed to only be changeable within Studio (scripts are not allowed to write it).

Although this property is intended to be set during game design and not during runtime, there is no way for dynamically loaded meshes (e.g. avatars) to have DoubleSided on by default.

If Roblox is able to address this issue, it would improve my development experience because I would like to be able to enable DoubleSided for players’ avatar meshes (body parts and accessories). I don’t know if there is a technical reason behind this restriction, but if this is possible otherwise I would really appreciate it.

22 Likes

You seem to have forgotten your use-cases. Hard to imagine why you would need this.

1 Like

Thanks for the feedback dragonfrosting! It would definitely be helpful to hear more about your use cases to help the team investigate it further.

6 Likes

@PeZsmistic @CountLoops

Since Roblox may be willing to implement this change, I’ll be candid and say that my intended use case is ViewportFrame mirrors.

mirror

I’m using the negative X-axis Camera matrix method which achieves mirrored textures and geometry, but causes geometry normals to be flipped. Thanks to the DoubleSided property, I can force MeshParts to render properly and achieve an effectively physically-accurate reflection.

However, due to DoubleSided’s Studio-only security, I can only correct MeshParts that I add within Studio. My avatar you see in this .gif is a StarterCharacter. Thus, it is virtually impossible for me to correct loaded meshes such as, and especially player avatars in-game.

I understand it’s not a wide use case, but this small limitation is the only thing stopping me from achieving this feature without undesirable workarounds or limitations.

10 Likes

This makes little sense – always be candid! How can they prioritize if they don’t know your use case? :slightly_smiling_face:

Your feature is more likely to happen when you specify clear use cases.

5 Likes

Oh, it’s not that I ever try to not be straightforward when I post, I was just hoping that I could keep the mirrors a surprise for a future thread. :sweat_smile: I get that my initial reasoning wasn’t much of a reason, though.


I’ll add a similar use case: this would allow developers to achieve “mirror worlds” via the same CFrame matrix method, without having to upload any additional meshes or maps with flipped geometry. Developers have wanted to create the Mirror Mode mechanic from Mario Kart, such as in this post.

It would already be possible for the most part, but again player avatars would appear inverted due to the inability to enable DoubleSided for their MeshParts.

3 Likes

Seems like it would have been better for the double-sided property to be an enum between Default, Inverted, and DoubleSided. Would make this use-case more efficient.

4 Likes

Yeah, given that DoubleSided works by doubling triangle count rather than disable backface culling, the best solution would be an option to simply flip the geometry normals. There could be more use cases for flipped normals, too, like making mesh outlines from any existing mesh rather than the outline being part of the original geometry.

For now, I would be golden if Roblox would be at least willing to remove the security on DoubleSided - since it can be changed during play testing in Studio, I don’t see any real technical limitations to changing it in realtime.

2 Likes

I’m aware that this is a 2 year old post, but I would love to have this feature still—albeit I’m not planning to make mirror system like OP is, I have my own use case intended for it (a confetti system). In my use case, I have a mesh part that I use for confetti piles on the ground, it’s a one sided mesh that can only be seen from the top.

I animate them along with particle emitters so whenever confetti is launched from something like a cannon, it would emit particles while the confetti pile mesh slowly fades in from the sky and floats and flattens down into the ground. For this part I have DoubleSided enabled to make the confetti piles look more full while floating down to the ground because it’s being viewed from all angles by players. (example picture only shows the mesh by itself with DoubleSided property on, no particle emitters.)

Once the confetti pile is on the ground in my case, I would disable the DoubleSided property since the mesh is only being viewed from the top angle by players and it would make it easier on the player’s device since their device wouldn’t be rendering extra triangles that they don’t even see.

However, you can’t modify this property via a script so currently my confetti pile meshes are still double sided even when stationary on the ground. I’ve had this confetti system made since December of 2023 with modifying the DoubleSided property in mind, but wasn’t able to do so. I just came across this thread now since I’m adding this system to another one of my games and thought of how useful modifying this property could be.

Disabling the DoubleSided property wouldn’t be that much of a performance boost with just one confetti pile mesh, but I make concert games with lots of confetti. That means lots of confetti pile meshes are spread out everywhere through a large performance venue. The player’s device is easily rendering tens of thousands of triangles from tons of these confetti piles with the DoubleSided property on, and being able to modify the DoubleSided property in my case would be really helpful. Roblox, please take this into consideration, thank you! :pray:

5 Likes

This would be a useful addition.

Our particular use-case is loading in player-built structures that use meshes that require this property to render properly.

1 Like

Currently if you need to use InsertService:CreateMeshPartAsync It’s impossible to properly setup the resulting MeshPart if it’s is intended to be DoubleSided.
It would be very much appreciated if this was made possible.

3 Likes

Seconded* With the new EditableMesh API, there’s a million use cases where DobuleSided fixes a ton of issues. Quick example is this wall I’ve made, can see inside the mesh/etc.

Double sided false

Double sided true

1 Like

As a workaround for this in the meantime, you can call ApplyMesh on a default MeshPart which has DoubleSided enabled. Using ApplyMesh doesn’t cause the DoubleSided (or Size) properties to update; meanwhile all other mesh-related properties are updated. You can then resize the mesh accordingly and use it as normal.

Only caveat is that the Mass and CenterOfMass properties somehow become slightly offset when using the method.

Little note in-case someone ends up using this solution: The FluidForcesEnabled property isn’t replicated over to the new mesh either; the FluidFidelity Enum property is replicated though.

1 Like