enableCollisionWith: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game version" to "|Game version=")
m (Text replacement - "↵↵</sqf>" to " </sqf>")
 
(37 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 0.50
|arg= local


|0.50|Game version=
|eff= global
|arg= local |Multiplayer Arguments=


|eff= global |Multiplayer Effects=
|gr1= Object Manipulation
____________________________________________________________________________________________


| Cancels the effects of [[disableCollisionWith]]. |DESCRIPTION=
|descr= Cancels the effects of [[disableCollisionWith]]. The collision is always enabled for both objects in the arguments, i.e. vehicle1 with vehicle2 and vehicle2 with vehicle1
____________________________________________________________________________________________
{{Feature|warning|Each object can contain only 1 reference to the object it disabled collision with. This command sets this reference to null. Therefore the command might not work as expected when trying to enable collisions with some objects but not other.}}


| vehicle '''enableCollisionWith''' vehicle |SYNTAX=
|s1= vehicle1 [[enableCollisionWith]] vehicle2


|p1= vehicle: [[Object]] |PARAMETER1=
|p1= vehicle1: [[Object]]


|p2= vehicle: [[Object]] |PARAMETER2=
|p2= vehicle2: [[Object]]


| [[Nothing]] |RETURNVALUE=
|r1= [[Nothing]]


|x1= <sqf>[_veh1, _veh2] remoteExecCall ["enableCollisionWith", 0, _veh1];</sqf>


|x1= <code>[_veh1, _veh2] [[remoteExecCall]] ["enableCollisionWith", 0, _veh1];</code>|EXAMPLE1=
|seealso= [[collisionDisabledWith]] [[disableCollisionWith]]
 
____________________________________________________________________________________________
 
| [[disableCollisionWith]] |SEEALSO=
 
|  |MPBEHAVIOUR=
____________________________________________________________________________________________
}}
}}


<h3 style='display:none'>Notes</h3>
<dl class="command_description">
<dl class='command_description'>
<!-- Note Section BEGIN -->


<!-- Note Section END -->
<dt></dt>
</dl>
<dd class="notedate">Posted on 2015-04-05 - 00:13 (UTC)</dd>
 
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on April 5, 2015 - 00:13 (UTC)</dd>
<dt class="note">[[User:Ranwer|Ranwer]]</dt>
<dt class="note">[[User:Ranwer|Ranwer]]</dt>
<dd class="note">
<dd class="note">


'''enableCollisionWith''' is a script that when you apply it to an object, it will be solid and the player will not be able to go through it. However, if you want your unit to go through it, you may want to use the '''disableCollisionWith''' command. An example for this is:  
'''enableCollisionWith''' is a script that when you apply it to an object, it will be solid and the player will not be able to go through it. However, if you want your unit to go through it, you may want to use the '''disableCollisionWith''' command. An example for this is:  
<code>//name of unit in editor such as player1
<sqf>
//name of unit in editor such as player1
//name of object in editor such as car1
//name of object in editor such as car1


Line 59: Line 42:


car1 disableCollisionWith player1;
car1 disableCollisionWith player1;
</code>
</sqf>
Both commands '''enableCollisionWith''' and '''disableCollisionWith''', are very handy codes and could be used for example: map testing, mission editing and even animation cutscenes.
Both commands '''enableCollisionWith''' and '''disableCollisionWith''', are very handy codes and could be used for example: map testing, mission editing and even animation cutscenes.


</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 19:48, 3 September 2024

Hover & click on the images for description

Description

Description:
Cancels the effects of disableCollisionWith. The collision is always enabled for both objects in the arguments, i.e. vehicle1 with vehicle2 and vehicle2 with vehicle1
Each object can contain only 1 reference to the object it disabled collision with. This command sets this reference to null. Therefore the command might not work as expected when trying to enable collisions with some objects but not other.
Groups:
Object Manipulation

Syntax

Syntax:
vehicle1 enableCollisionWith vehicle2
Parameters:
vehicle1: Object
vehicle2: Object
Return Value:
Nothing

Examples

Example 1:
[_veh1, _veh2] remoteExecCall ["enableCollisionWith", 0, _veh1];

Additional Information

See also:
collisionDisabledWith disableCollisionWith

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on 2015-04-05 - 00:13 (UTC)
Ranwer
enableCollisionWith is a script that when you apply it to an object, it will be solid and the player will not be able to go through it. However, if you want your unit to go through it, you may want to use the disableCollisionWith command. An example for this is:
//name of unit in editor such as player1 //name of object in editor such as car1 car1 enableCollisionWith player1; //to make your unit go through the car, use the below and make sure you know what your doing! car1 disableCollisionWith player1;
Both commands enableCollisionWith and disableCollisionWith, are very handy codes and could be used for example: map testing, mission editing and even animation cutscenes.