Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a possible way to script a working mirror that shows the player and items?

Asked by 6 years ago

I want to know how to make a mirror but I don't know if it's possible can someone help me?

4 answers

Log in to vote
0
Answered by 6 years ago

I'm not sure if you are able to make a mirror that 'reflects' everything, however, there is a way you can make it seem like a mirror.

You could have the real 'area' that you want to mirror, and then have a clone of it. The mirror itself would be transparent, however, the cloned area will be moving in the opposite direction everything in the real game would be moving. This would create a fake mirror effect.

This is the only way I know of that would look the best, but I'm sure there are probably better options out there.

0
Fudge, you answered 20 seconds before me;-; oggy521 72 — 6y
0
lol rip Operation_Meme 890 — 6y
Ad
Log in to vote
0
Answered by
oggy521 72
6 years ago

I'm sure it is possible, I've seen it on some games. Though from my knowledge it doesn't seem that the lua engine can support something like that, but, I think a trick you can use is to have a transparent glass in the middle, and on the other side, a completely symmetrical room of the room where the mirror would be facing, and then go from there.

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

With a lot of complicated math, yes. I believe you would want to do a bunch of raycasts to get the color, size, and positions of parts infront of the mirror, then use that data to construct a picture using a surfacegui

Or if you want to do it the ghetto way and have a huge mirror that takes up a ton of space you can use the previous 2 answer's methods (which was the same thing)

Log in to vote
0
Answered by
Zafirua 1348 Badge of Merit Moderation Voter
6 years ago
Edited 6 years ago

Short Answer Yes but it will look extremely ugly. It isn't something that can be handled well in Roblox.

When you look yourself in mirror reflection, everything reflects back. This includes body, clothes, hair, objects, and etc.

The thing about mirroring in Roblox is that, it isn't possible to reflect back the meshes or the hats that you see. Nor can you mirror the shirts, pants or even textures or decals. This really limits on creating an actual mirror.

Mirroring an image will involve in heavy Raycast since it will be casted quite a lot per second. In real world, mirror changes images in an instant. If you were to try to optimize mirror for the sake of performance, then the mirror, if you did create it, will have a delayed transitioned.

And that is no good either.

Another way is by using Raycasting and casting it to the SurfaceGui. Again, if a player has accessories, there is no way to reflect them back. It only basically works with BasePart.

A way in which BlueTaslem did in creating a mirror is a unique way but it is really complicated. He, in one of his models, attempted on cloning the local player from one side to another in a fixed part position.

Basically there is a Mirror and he tried to mirror your image by rapidly transitioning the player to the other side and transitioning back.

This did not completely work because how the of default roblox camera works.

If you do want to go on great lengths, then you will have to change quite a lot of default property just to see a slight better result. Again, slight.

In conclusion, although you are more than welcome to try to become the first player to successfully create one which includes all the flaws I mentioned.

I highly recommend looking at this answer by BlueTaslem. Code is advanced and needs good math and lua knowledge prior to making it.

Looking forward to see how you achieve this miracle!

Answer this question