SetObjectEditorSpeed

From Onset Developer Wiki
Revision as of 15:33, 9 March 2020 by 28days (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
SetObjectEditorSpeed

Type: Function
Context: Client
Introduced: v1.0

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