getObjectScale: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|game([0-9]) ?= (.+) \|version([0-9]) ?= (.+) " to "|game$1= $2 |version$3= $4 ")
m (Some wiki formatting)
Line 14: Line 14:
|r1= [[Number]] - Scale relative to the original model
|r1= [[Number]] - Scale relative to the original model


|x1= <code>_scale = [[getObjectScale]] _object;</code>
|x1= <sqf>
private _objectScale = getObjectScale _object;
 
if (_objectScale != 1) exitWith { hint "all good" };
if (_objectScale > 1) then
{
hint "it's bigger!";
}
else
{
hint "it's smaller...";
};
</sqf>


|seealso= [[setObjectScale]]
|seealso= [[setObjectScale]]
}}
}}

Revision as of 13:52, 5 May 2022

Hover & click on the images for description

Description

Description:
Returns the render scale of the object relative to the original model.
Groups:
Object Manipulation

Syntax

Syntax:
getObjectScale object
Parameters:
object: Object - Object to return scale of. Can also be a terrain object
Return Value:
Number - Scale relative to the original model

Examples

Example 1:
private _objectScale = getObjectScale _object; if (_objectScale != 1) exitWith { hint "all good" }; if (_objectScale > 1) then { hint "it's bigger!"; } else { hint "it's smaller..."; };

Additional Information

See also:
setObjectScale

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