This time I have more of a Unity than AC question. I hope it's okay to ask here?

In my scene I've got a background with a hole in the middle where there is supposed to be a mirror.
I figured I'd make a cube 3D object and place it behind, then project view from one of the cameras onto it (not sure if it should be the main camera or one of the scene cameras) using render texture. But I've been toying this for a couple of hours now and while some room sprites get reflected the player character does not ( and even if it does it is not reflecting the walking animation or movement of any sort, just still image).
So, the question is: could anyone guide me through this? - how do we make a working mirror in a 2D sidescrolling game where you can only move left/right?
Comments
Here's a graphic example so maybe someone can give me some ideas (pretty please!
The red area is transparent. The player reflection seen here is just a photoshop mockup to illustrate what I'm trying to achieve.
Thanks again, Alverik!
For anyone else trying to use this in the future: make sure you rotate your mirror slightly, otherwise the reflection is completely hidden behind the character which might at first make you think it's not actually there (I did :P ).
Anyway, another problem solved
apologies for a "necromancy" - that is: responding to a more than a year-old thread, but I stumbled upon a problem while trying to use the "Hedgefield Method" - it seems I cannot get the reflection correct - it's reflecting the character the other way and while moving next to the mirror (and the reflection direction is wrong..) Can you give me a hint what I am doing wrong here? I've spent several hours on it and I am quite puzzled
Take a look:
Last but not least: thanks for all the hints above and for magnificent tools you provided me with, Sirs!
You may need to contact @hedgefield directly, as he's the author of the method in question. I expect you'll also need to provide more details about your setup, as the image doesn't show much in the way of how you've achieved this.
I can't remember how I've done it... but it's definitely possible.
It would certainly be interesting!
Ressurecting this old thread. saw your AGS game and this mirror effect in the bedroom was exactly the effect I was going for (reflection in a store window).
I had a similar idea as you with a duplicate character.
Is there an "AC" way of controlling 2 characters at once like you describe in your AGS script @ChrisIceBox ?
Hi! I was to know the same
As Unity allows you to get/set a SpriteRenderer's sprite property through script, you wouldn't need a duplicate character - just a separate SpriteRenderer in the scene to act as the mirror, set to update it's own Sprite/Position based on that of the character it's representing.
Something like this:
It work amazing Chris thanks. I just used this script for the reflex of the floor *and look great!, but If I want a mirror, for example in the wall I need the oposit animation, if the player is from the back I need reflex the front sprite... (I try to use a shader but the problem is the same haha). Maybe I need make something more complex in the script but now I have a idea!, thanks
Hey. huge thanks! its really cool that you put the time in to making a script!
thats very useful for certain reflective surfaces.
But in your AGS game you have a flat mirror against the back wall.
where if the characters back is turned towards the mirror the mirror shows the back of the head.
I had an idea of a dummy character behind the wall mimicing the player as you did. But with flipped animations for up and down. not sure how to control that in AC though. or if its even the best way to do it.
Pic from your trailer
https://imgur.com/a/GsrKlp5
Ah, quite right.
In that case, using a dummy character may be the better way after all. How it works exactly would depend on the original character's animation engine, but it's probably easiest to rely on Sprites Unity Complex. That way, you can read their move/direction parameter values, modify them as necessary, and apply them to the dummy character: