View Single Post
Old
SirThorfinn
Senior Member
 
SirThorfinn's Avatar
 
Status: Offline
Posts: 232
Join Date: Sep 2010
Location: Some where Unreal!
Talking 09-28-2010, 06:10 PM

Quote:
Originally Posted by Dameria View Post
You can make separate boolean variables for each action of your person. For example, lets say you have the ability to look down your sights, but you don't want people to be able to do it while reloading. Create a boolean variable called "isReloading" and keep it set it to default "False". Now in the event where you call upon the gun reloading, just put an if/else statement in the place of that method and put "if(isReloading), do nothing; else, person.aimDownSights". Now in the method where you are reloading, in the method itself before you do anything else, set "isReloading" to "True" in the beginning, and then when the animation finishes, set "isReloading" to "False" again. This way, when you go to reload, it will turn the boolean on, therefore disabling you from aiming down your sights, and as soon as the reloading ends and the boolean turns back to false, you can aim down your sights again. You can repeat this process with all of your other methods that you do not want to happen while reloading. Or you can create difference booleans so that, lets say you cannot reload while you are running, or look down your sights while you are running.
Thanks for the help it works perfectly
   
Reply With Quote