In the prototype on which I am currently working, I've been running into an issue with the "fans" in the level. What I need them to do is push the player into the air and hold them levitating for awhile, bobbing the player up and down a bit automatically without the player having to hit buttons.
At first, I attempted to solve this problem with physics volumes. I had used these to pretty good effect before in regards to fans pushing the player off to the side while they tried to navigate through a level. Unfortunately, physics volumes seem an imperfect solution. While they make it very easy to alter a player's trajectory, they aren't good for pushing a player automatically since, it seems to me, the player needs to jump into the air first or make some kind of movement within the physics volume in order for the volume to push the player up. This issue remained even after I made sure the option to have physics enable as soon as the player touched the volume was turned on. I had this same issue with a gravity volume; while the way a gravity volume floats a player around is very useful, it doesn't seem to kick in unless a player first jumps. Since I'm going to be disabling the jump function for the final version of the game, this is a big problem.
Moreover, neither of these options really "juggle" the player. The physics volumes can push the player up and let them float back down, but they don't seem to continuously push the player up like the way they'll continually shove the player to the side when the player is walking. I'm guessing this has to do with the physics volume needing the player to move in the Z direction in order to push him in that direction.
After a bit of thinking of other ways around the problem, I've come to what I consider a pretty clever solution. What I'm going to do is place an invisible platform over the vertical fans in the levels. These platforms will have a rapid up and down animation attached to them which will play continously. When the player steps onto a fan platform, they'll be juggled up and down seeimgly by the force of the fan alone.
In order for this to solve my problem, I'm going to need to learn how to switch between animations depending on if the player is set to different weights. I've got a loose idea about how to do this at the moment. I'm guessing that I'll need to have different matinees for however many different animations I'll need for a vertical fan in a given level (three at most), each triggered depending on player button presses.
No comments:
Post a Comment