SetObjectEditorSpeed: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Set the object gizmo editor's speed.}} | ||
{{FuncSyntax|SetObjectEditorSpeed(speed)}} | {{FuncSyntax|SetObjectEditorSpeed(speed)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|speed| | {{FuncParam|speed|The speed in UE4 units.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|This function returns '''nil'''.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang='Lua'> | |||
-- Server side | |||
local function Editor_CommandObjectSpeed(player, speed) | |||
if not IsValidPlayer(player) then return end | |||
if speed == nil then return AddPlayerChat(player, 'Usage: /objectspeed <speed>') end | |||
speed = tonumber(speed) | |||
if (speed < 0 or speed > 200) then return AddPlayerChat(player, 'Object speed must be between 0 and 200.') end | |||
AddPlayerChat(player, 'Object speed set to ' .. speed .. '.') | |||
CallRemoteEvent(player, 'SetEditorSpeed', speed) | |||
end | |||
AddCommand('objectspeed', Editor_CommandObjectSpeed) | |||
-- Client side | |||
local function SetObjectEditorSpeed(speed) | |||
SetObjectEditorSpeed(speed) | |||
end | |||
AddRemoteEvent('SetEditorSpeed', SetObjectEditorSpeed) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} |
Latest revision as of 15:33, 9 March 2020
Description
Set the object gizmo editor's speed.
Syntax
SetObjectEditorSpeed(speed)
Parameters
- speed
The speed in UE4 units.
Return Value
- This function returns nil.
Example
-- Server side
local function Editor_CommandObjectSpeed(player, speed)
if not IsValidPlayer(player) then return end
if speed == nil then return AddPlayerChat(player, 'Usage: /objectspeed <speed>') end
speed = tonumber(speed)
if (speed < 0 or speed > 200) then return AddPlayerChat(player, 'Object speed must be between 0 and 200.') end
AddPlayerChat(player, 'Object speed set to ' .. speed .. '.')
CallRemoteEvent(player, 'SetEditorSpeed', speed)
end
AddCommand('objectspeed', Editor_CommandObjectSpeed)
-- Client side
local function SetObjectEditorSpeed(speed)
SetObjectEditorSpeed(speed)
end
AddRemoteEvent('SetEditorSpeed', SetObjectEditorSpeed)
See also
- GetObjectCount
- GetObjectModelCount
- GetObjectModelGroup
- GetObjectModelName
- GetStreamedObjects
- GetObjectModel
- GetObjectLocation
- GetObjectRotation
- GetObjectScale
- GetObjectBoundingBox
- GetObjectSize
- EnableObjectHitEvents
- GetObjectMass
- SetObjectEditable
- SetObjectOutline
- SetObjectCastShadow
- SetObjectColor
- SetObjectEmissiveColor
- SetObjectTexture
- SetObjectAnimatedTexture