Jump to content
distortedseed

Make the player hold animation

Recommended Posts

Hey guys, I searched everywhere but couldn't find an answer to this.

So, basically what I'm wanting to do is something kinda like have the player press a key then put their hands up and the animation holds until the key is pressed again.

...so that gives me a few ideas but not sure which one will actually work

1. is there a way to have the player press a key and the first part of the animation plays then holds at a particular frame until the key is pressed again then continue the animation?

2.would I need to make 2 animations 1 for hands up and the second for hands coming down after the key is pressed again?

3. how to make an animation simply pause and not go to any other idle animation or anything until the key is pressed again?

 

Thanks for your time.

Share this post


Link to post
Share on other sites
On 2/8/2017 at 11:43 AM, distortedseed said:

Hey guys, I searched everywhere but couldn't find an answer to this.

So, basically what I'm wanting to do is something kinda like have the player press a key then put their hands up and the animation holds until the key is pressed again.

...so that gives me a few ideas but not sure which one will actually work

1. is there a way to have the player press a key and the first part of the animation plays then holds at a particular frame until the key is pressed again then continue the animation?

2.would I need to make 2 animations 1 for hands up and the second for hands coming down after the key is pressed again?

3. how to make an animation simply pause and not go to any other idle animation or anything until the key is pressed again?

 

Thanks for your time.

https://community.bistudio.com/wiki/inputAction

inputAction should be really useful for this kind of stuff.

You can assign code to a user control or any other type of keyboard control, they have all of them there.

just execute something like this locally (initPlayerLocal or similar) :

if(inputAction "User1" > 0) then {
hint "We're pressing User1!";
};

and you can use BIS_fnc_loop for a looping cycle, otherwise it'll only see if the input action is active

initially.

["itemAdd",["inputLoop",{
if(inputAction "User1" > 0) then {
hint "we're pressing User1!";
};
}]] call BIS_fnc_loop;

one thing to note, instead of returning a boolean. InputAction will return a 1 or a 0.

1 being active and 0 being not active.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×