- Home /
How to reflect an object.
Hi,i'd like to know how to reflect an object while playing, I mean that everything above the floor can be reflected. Thanks :)
I dont know if this helps you, but if you invert the transform.scale property it inverts the object along the axis of the degree of the vector in witch you inverted
Answer by Nemox · Feb 23, 2013 at 03:15 AM
Most reflections in games are actually just a trick; displaying another texture (usually a cubemap) in the lowly-lit shiny parts of the object's material. It's a very subtle effect but very powerful.
For a full realtime reflection, you'll have to rely on Render Textures; a camera in your scene that looks at the scene from another angle and applies it to the texture on the mirror's (or other shiny surface) material. You can even set this particular camera to only render certain objects or at only a certain distance so it's not hard on performance.
You'd likely also want to make a script that updates the reflection camera's position based on the angle that the main camera is looking at.
Thanks for the response. I understand, I'm gonna search a bit and if there is any trouble I'll post :) Thanks again ;D