How would you do about this issue where I want to force the player to walk while sprinting and trying to aim but if I held the sprint button during the aim it will sprint again after I release aim.
You won’t need any of these variables for this task (though you can still keep them if you’re gonna use them in other parts)
Just place a Gate
node before setting the character’s max walk speed to your sprint speed, and connect it’s Enter
input exec pin to the Triggered (or Started
if it’s a toggle) pin of your sprint IA.
Then you can simply set the max walk speed to your walk speed after the Triggered or Started pin of your Aim IA, then connect either the Triggered or Started pin of your Aim IA to the Close
pin of the Gate
node, and connect the Completed
pin of your aim IA into the Open
pin of the Gate
.
Hope this helps!
Hey thanks for your time. I am actually using the Game Animation Sample and I am not sure I can do that easily. Do you have any experience with that project?
I don’t recommend advancing from a template project. Some stuff in other parts of the project might be overriding what you did, and it could be a hard time finding what it is, since you’re not the one who made it.
If your reason to advance from the Game Animation Sample Project is to be able to use motion matching animations, you can still import the character to a new blank project with all of it’s dependencies, or can make your own!
I am just messing around with this project nothing too serious. Will see what you said in another project to see if that solves the issue. Thanks again.
In these cases I think it would be better to use two variables “Is” and “Can”. If you don’t want aim when running, it is CanAim that you have to set to false. Use “is” for the logic of the action itself and use “can” so that the actions are blocked between them.
Will see how I can do that. Thanks a lot.