Vehicle::setDamage: Difference between revisions
No edit summary |
(→Syntax) |
||
| Line 5: | Line 5: | ||
You need to apply delay if you want to call setDamage couple times in a row. Typically 10ms is enough. | You need to apply delay if you want to call setDamage couple times in a row. Typically 10ms is enough. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="javascript">vehicle.setDamage(xOffset, yOffset, zOffset, damage, radius, | <syntaxhighlight lang="javascript">vehicle.setDamage(xOffset, yOffset, zOffset, damage, radius, focusOnModel);</syntaxhighlight> | ||
=== Required Arguments === | === Required Arguments === | ||
*'''xOffset:''' float | *'''xOffset:''' float | ||
| Line 16: | Line 16: | ||
===Return value=== | ===Return value=== | ||
*'''Undefined''' | *'''Undefined''' | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
Latest revision as of 21:53, 29 April 2021
Apply damage to vehicle at a location. Location is relative to vehicle model (not world).
Radius of effect damage applied in a sphere at impact location
It is enough to use x,y,z values from -1 to 1.
When focusOnModel set to true, the damage sphere will travel towards the vehicle from the given point, thus guaranteeing an impact
Good values for radius could be from 25 to 200, for damage 50-200.
You need to apply delay if you want to call setDamage couple times in a row. Typically 10ms is enough.
Syntax
vehicle.setDamage(xOffset, yOffset, zOffset, damage, radius, focusOnModel);
Required Arguments
- xOffset: float
- yOffset: float
- zOffset: float
- damage: float
- radius: float
- focusOnModel: Boolean
Return value
- Undefined
Example
// todo