16
Technical forum / Re: Mirror reflection for 2D character
« on: November 07, 2017, 04:13:49 PM »
I think eborr means that you "simulate" the mirror with a second actor entity. It will not be very straightforward but I think you can achieve this with some work.
So, you create a second actor entity with the same animations as your main actor. You arrange so that the area below the mirror is a Sprite Entity. In this sprite entity you will set an image. The image must be the area below the mirror. This way, you will place your second actor behind this area, so that his lower body is cut off. Perhaps the image should extend left and right of the mirror, so you can show part of the actor as he enters the area in front of the mirror.
Then, you will set a region entity on the floor around the mirror. You can catch the event ActorEntry inside the region and start your code. The code must copy the main actor's movements, meaning for every move the main actor takes, the second actor must do the same (right-left). For up-down I guess you want the opposite movement.
Then, you can catch ActorLeave event to stop this behaviour and perhaps unload the second actor.
I have described it very roughly and probably missed some important points (maybe eborr meant an animation instead of a second actor entity?). I guess you can start and then seek help here again when you are stuck.
So, you create a second actor entity with the same animations as your main actor. You arrange so that the area below the mirror is a Sprite Entity. In this sprite entity you will set an image. The image must be the area below the mirror. This way, you will place your second actor behind this area, so that his lower body is cut off. Perhaps the image should extend left and right of the mirror, so you can show part of the actor as he enters the area in front of the mirror.
Then, you will set a region entity on the floor around the mirror. You can catch the event ActorEntry inside the region and start your code. The code must copy the main actor's movements, meaning for every move the main actor takes, the second actor must do the same (right-left). For up-down I guess you want the opposite movement.
Then, you can catch ActorLeave event to stop this behaviour and perhaps unload the second actor.
I have described it very roughly and probably missed some important points (maybe eborr meant an animation instead of a second actor entity?). I guess you can start and then seek help here again when you are stuck.