How to make a hero go up along with the elevator

So I understand how to make an elevator go up to a specific floor, but I can't seem to make the hero go up along with the elevator to the specific floor.

Please help.
First idea that came into my head; identify that the hero object is inside the elevator, and if he is, on every recalculation of positions, change the hero's height to match the elevators height.
could you please post what you mean in codes would really help!
The short answer is no. I can't see your code, I don't know anything about how your game engine decides where the hero is positioned or what the elevator height is, so I can't write any code for you.
void moveelevator(char X[][80], int RH,int CH, int &Ed, int &Eu)
{
if(RH+1==Ed+1&&CH+1>73)
{
if(Ed<25)
{


Ed--;
Eu--;
RH=Ed;

}
}

}

this is the function I'm trying to do RH stands for the Row the Hero is currently onand CH stands for column the hero is currently on. Ed stand for the row of the lower part of the design of the elevator and Eu stands for the upper. I tried implementing what you told me is what I'm doing right?

(Edit: The +1 after the RH and CH is because the hero has legs and I'm assuming that the RH itself is the body)
Last edited on
Topic archived. No new replies allowed.