Jump to content
Sign in to follow this  
KingoftheSandbox

Unit does not move after animation eventhandler

Recommended Posts

I use this code to make an AI unit to play both moves, after the AI did this, it turns around but cant move no more.

nato_pilot_1 switchMove "Acts_UnconsciousStandUp_part1";
nato_pilot_1 addEventHandler ["AnimDone", {nato_pilot_1 playMove "Acts_UnconsciousStandUp_part2"}];

I tried removeAllEventhandlers command, with no luck. help appreciated!

Share this post


Link to post
Share on other sites

I think you need to do a third switchmove , cant recall the exact one maybe even "" or a setbehaviour , im sure a search will get you there sorry for being vague

Share this post


Link to post
Share on other sites

Thanks! One of these did it.

nato_pilot_1 switchMove "";

nato_pilot_1 playMove "";

nato_pilot_1 setBehaviour "AWARE";

---------- Post added at 00:48 ---------- Previous post was at 23:45 ----------

This is so strange. It just worked, now it doenst anymore. I didnt change anything;-(

Share this post


Link to post
Share on other sites
Thanks! One of these did it.

nato_pilot_1 switchMove "";

nato_pilot_1 playMove "";

nato_pilot_1 setBehaviour "AWARE";

---------- Post added at 00:48 ---------- Previous post was at 23:45 ----------

This is so strange. It just worked, now it doenst anymore. I didnt change anything;-(

Welcome to ArmA scripting ;)

Share this post


Link to post
Share on other sites

I need help with the same thing!

player switchMove "Acts_UnconsciousStandUp_part1"; player addEventHandler ["AnimDone", {player playMove "Acts_UnconsciousStandUp_part2"}];

I can't move after both animations have been played... Im just sliding slowly backwards.

Share this post


Link to post
Share on other sites
I still need help! :(

For those who have not found an answer. ( think you already got it to work Chillroy :) )

Add this: player removeEventHandler ["AnimDone", 0]

player switchMove "Acts_UnconsciousStandUp_part1"; player addEventHandler ["AnimDone", {player playMove "Acts_UnconsciousStandUp_part2"; player removeEventHandler ["AnimDone", 0]}]; and it will not get stuck in some infinite loop.

... hummm seems that you only need the first one ( player switchMove "Acts_UnconsciousStandUp_part1"; ) the rest is useless or I mean needless. The soldier will automatically play the part2. Checked with animationState player

Edited by AsperitZ
I should be in bed!

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
Sign in to follow this  

×