Vehicle (tank) for my character


I have a problem, I want my character control a tank for a little period of time on my game. So I need ideas for doing an script. First by a collider I want the player disappear and you control the tank (but I want to store in some way my character inside the tank, I want to stop using the tank by using jump button). So I don't know how to do it. It's important too to say that the character prefab, have some hiden parts, by default, so I don't know if this is a problem.

What I can do to solve my problem?

Lot of thanks

When the character collides with the tank, assign a GameObject variable on the tank to the player object. Then call SetActiveRecursive(false); on the player object. After that enable the tank controls.

To get the character out of the tank make the Jump button and control on the tank itself that when pressed calls SetActiveRecursive(true); on the player GameObject variable you set earlier and sets the player's position to the position you want them to be when the jump out of the tank begins.

Good luck.