FindObject

FindObject is a function that finds an object.

Overload #1 finds by either class name or short object name.

Overload #2 works the same way as FindObject in the UE source.

Parameters (overload #1)

#TypeInformation
1string|FName|nilThe short name of the class of the object
2string|FName|nilThe short name of the object itself
3EObjectFlagsAny flags that the object cannot have. Uses | as a seperator
4EObjectFlagsAny flags that the object must have. Uses | as a seperator

Param 1 or Param 2 can be nil, but not both.

Parameters (overload #2)

#TypeInformation
1UClassThe class to find
2UObjectThe outer to look inside. If this is null then param 3 should start with a package name
3stringThe object path to search for an object, relative to param 2
4boolWhether to require an exact match with the UClass parameter

Return Value (overload #1 & #2)

#TypeInformation
1UObjectThe derivative of the UObject

Example (overload #1)

-- SceneComponent instance called TransformComponent0
local Object = FindObject("SceneComponent", "TransformComponent0") 
-- FirstPersonCharacter_C instance called FirstPersonCharacter_C_0
local Object = FindObject("FirstPersonCharacter_C", "FirstPersonCharacter_C_0", EObjectFlags.RF_NoFlags, EObjectFlags.RF_ClassDefaultObject)

Example (overload #2)

local Object = FindObject(UClass, World, "Character", true)