- Home /
FPS-Parkour Mode?
I was wondering something- How would you be able to change from one movement type to another? For example- Parkour-Shooter Shooter-Sneak Sneak-Parkour ETC? Thanks in advance.
Answer by 2d4Games · Aug 15, 2013 at 02:00 AM
Inside a script file, you could make a setting that will change how the character movement is calculated.
var gameType = 0;
//0 for Parkour-Shooter
//1 for Shooter-Sneak
//2 for Sneak-Parkour
switch (gameType){
case 0: //put Parkour-Shooter movement code here
case 1: //put Shooter-Sneak movement code here
case 2: //but Sneak-Parkour movement code here
}
Depending on how you want to change the movement type, you could either set the variable to change when the player presses a key, selects an option in a menu, or you can set them in scripts if you don't want the player to have a choice between the movement modes.
Thanks. I was really wondering about that. And the variable is the "//#" thing, correct? Sorry, I'm new to Unity. I'm really nooby at this XD
The variable is gameType. The //# thing is just saying what you can set gameType to (when you put two slashes at the start of a line, the program ignores that line. It's called a "comment"). If you do gameType = 1, then the program will do the Shooter-Sneak movement code. If you do gameType = 2, then the game will do the Sneak-Parour movement code. Etc.
$$anonymous$$$$anonymous$$, thanks. I get what you mean now. Good day sir!
Would you $$anonymous$$d setting my answer as "accepted"? I would appreciate it :D
isn't there a little checkmark button underneath the thumbs down?