i need a little help - again.
I’m trying to create a Power Up which allows my player to fly around (it’s an infinite runner), an basically it shall be a creature, on which the character hops on and then rides it. I got the mechanics for the “flying” (basically it works like a jetpack…), but what I’m struggling with is how to change the sprite and colliders of my character. Of course, while riding the creature, my character shall not touch the ground by himself,but the creature shall do. So I thought of 2 methods:
1: animate that whole thing. Create a new animation sprite which includes the player and the creature, change the colliders and everything during that animation. As soon as picking up the creature, the actual PowerUp-Object is destroyed and the animation plays. I guess this is very intensive in terms of performance…
2: create the creature as a child-gameobject of the character and set it active by picking up the powerup and deactivate it afterwards until the power up is picked up again…
but in this method there is still the question about the collisions - how could I tell the character, that he doesn’t “fall through” the creature but keeps sitting at it. If the creature touches the ground, it may run (what else?!..)
I also thought about picking up the whole creature and attach it as child as soon as the player hits it, but that caused some weird issues which were related to the fact that the power up might be spawned several times during the run (at least I guess the issue was in relation to that).
Has anyone done something comparable or an idea how to best realize that? Would be awesome!
Thanks in advance!