How to flip an asset along an axis without using scale?

I have a bridge that I want to flip over on the X axis. The problem is that I can’t use negative scaling to do this operation because it has boxcolliders on it. Box Colliders cannot have negative scales: ( Collider Issues with Negative Scale )

I can’t remove the box colliders on it because I have a script that relies on the fact that it needs a BoxCollider.

Anyway, this all leads to this question: How can I flip a gameObject without using scale manipulation?

if 180 rotation do not help, put the model into hierarchy and flip it using negative scale, leaving box collider and positive scale on the parent object.

1 Like

You can rescale Game Object with mesh. Then keep collided as separate Game Object. But if your collider does not fit then, you need modify bridge collider, or mesh of bridge, in external software.

Depending how complex collider is.

As @Antypodish noted above, it might be easiest to just modify the mesh of the bridge, assuming you’re okay doing it at runtime. Modifying meshes at runtime is incredibly easy in Unity3D and would involve:

  • iterate all verts and negate them across the axis you want (probably X axis?)
  • rewind all the triangles so they face the right way (A,B,C likely becomes A,C,B)
  • write it back to the mesh.

You could do all that at editor time too but it would require re-serializing the flipped mesh and creating a mesh asset on disk, etc. It might be easiest to pull it up in whatever 3D program you made it in and flip it that way.

2 Likes