Kydoimos 916 Posted February 12, 2014 I'm trying to create a camera shake effect when the player is close to a destroyed helicopter: _Helicopter addEventHandler [ "Killed", { // Only shake the camera if appropriate if Player distance _Helicopter < 40 then { addCamShake [10, 0.8, 20]; }; } ]; I've defined _Helicopter. Any ideas where I've gone wrong? Thanks for any help / suggestions! Share this post Link to post Share on other sites
Tankbuster 1747 Posted February 12, 2014 I'm trying to create a camera shake effect when the player is close to a destroyed helicopter:_Helicopter addEventHandler [ "Killed", { // Only shake the camera if appropriate if (Player distance _Helicopter < 40) then { addCamShake [10, 0.8, 20]; }; } ]; I've defined _Helicopter. Any ideas where I've gone wrong? Thanks for any help / suggestions! 5char Share this post Link to post Share on other sites
lappihuan 178 Posted February 12, 2014 I'm not sure, but does addCamShake not need a unit to be applyed? Like: player addCamShake [10, 0.8, 20]; Share this post Link to post Share on other sites
Tankbuster 1747 Posted February 12, 2014 You're right, it doesn't. It applies to the camera, not a unit. Share this post Link to post Share on other sites
lappihuan 178 Posted February 12, 2014 Ok, was not sure because the wiki is still down and i was not able to check it... Share this post Link to post Share on other sites
Kydoimos 916 Posted February 12, 2014 Hi all - thanks for your suggestions! I tried it with brackets but still didn't have any luck. But then I started thinking, could it be because the event handler 'KILLED' is applied to an empty Helicopter? Maybe it doesn't count as 'KILLED'? Share this post Link to post Share on other sites
lappihuan 178 Posted February 12, 2014 it count as killed... no errors in the RPT? Share this post Link to post Share on other sites
f2k sel 164 Posted February 12, 2014 you can't use _Helicopter as it's seen as local variable even though it's a name, remove the underscore or use (_this select 0) inside the EVH Share this post Link to post Share on other sites
Kydoimos 916 Posted February 12, 2014 Interesting! Ok, I'll endeavour to give that a go. Cheers, Share this post Link to post Share on other sites
Kydoimos 916 Posted February 19, 2014 Worked perfectly - thanks! Share this post Link to post Share on other sites