Jump to content
Sign in to follow this  
koalasalad

Does the "if condition" only works for >?

Recommended Posts

I am making a basic script which activates once the vehicle "bus1" gets within 10 meters.

So i have this but it doesn't work:

if (bus1 distance trap1 < 10) then {bus1 setHit ["wheel_2_1_steering", 1]; bus1 setHit ["wheel_2_2_steering", 1]; bus1 setHit ["wheel_1_1_steering", 1]; bus1 setHit ["wheel_1_2_steering", 1]};

If I switch it to > instead of < then it works but i don't want it to activate if the distance is greater then 10. I want it to activate if the distance is less then 10.

Share this post


Link to post
Share on other sites

Where is trap1 located? Are you sure it's not at [0,0,0] or something? That can happen if you try to setPos the trap to an undefined position.

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  

×