Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
BEAKSBY

How to "disableCollisionWith" with all vehicles and units

Recommended Posts

Hi All,

I have freight boxes in my mission that when a player is within 10m it moves away and the player collects the money inside.

waitUntil {sleep 0.1; ((player distance _box) < 10)}; 
_box setPosATL [0,0,100];

BUT, if the player is driving, and is going too fast he'll crash into and die. Not the desired result.

How do I make the _box disableCollisionWith any unit or vehicle if the locality changes?

This is not working:

[_box, vehicle player] call SVAGLOBAL;
SVAGLOBAL = {if (local (_this select 0)) then {(_this select 0) disableCollisionWith (_this select 1);  //REMOTE vehicles (not local to client)
} else {[_this,"SVAGLOBAL",_this select 0,FALSE,TRUE] call BIS_fnc_MP;};};

Edited by BEAKSBY

Share this post


Link to post
Share on other sites

Try vehicle player instead of player in waitUntil. It is pretty strange, you have to be moving faster than 200 mph for the loop to not lift box in time. On the other hand if you have many many boxes all using waitUntil, then it is understandable.

Share this post


Link to post
Share on other sites
Try vehicle player instead of player in waitUntil. It is pretty strange, you have to be moving faster than 200 mph for the loop to not lift box in time. On the other hand if you have many many boxes all using waitUntil, then it is understandable.

THanks, I do have multiple boxes, but they only spawn about once a minute.

Share this post


Link to post
Share on other sites
If one or both objects change locality, the command needs to be executed again on the new owner's machine(s) to maintain the effect.

Unless you're running this on a dedicated server, or there are other players in your game, you don't need to worry about this

Share this post


Link to post
Share on other sites
Sign in to follow this  

×