UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FScriptInterface Class Reference

#include <ScriptInterface.h>

+ Inheritance diagram for FScriptInterface:

Public Member Functions

 FScriptInterface ()=default
 
 FScriptInterface (UObject *InObjectPointer, void *InInterfacePointer)
 
 FScriptInterface (const FScriptInterface &)=default
 
FScriptInterfaceoperator= (const FScriptInterface &)=default
 
UE_FORCEINLINE_HINT UObjectGetObject () const
 
UE_FORCEINLINE_HINT TObjectPtr< UObject > & GetObjectRef ()
 
UE_FORCEINLINE_HINT voidGetInterface () const
 
void SetObject (UObject *InObjectPointer)
 
UE_FORCEINLINE_HINT void SetInterface (void *InInterfacePointer)
 
UE_FORCEINLINE_HINT bool operator== (const FScriptInterface &Other) const
 
UE_FORCEINLINE_HINT bool operator!= (const FScriptInterface &Other) const
 
void AddReferencedObjects (FReferenceCollector &Collector)
 

Protected Member Functions

COREUOBJECT_API FArchiveSerialize (FArchive &Ar, class UClass *InterfaceType)
 

Friends

uint32 GetTypeHash (const FScriptInterface &Instance)
 

Detailed Description

This utility class stores the FProperty data for an interface property used in both blueprint and native code. For objects natively implementing an interface, ObjectPointer and InterfacePointer point to different locations in the same UObject. For objects that only implement an interface in blueprint, only ObjectPointer will be set because there is no native representation. UClass::ImplementsInterface can be used along with Execute_ event wrappers to properly handle BP-implemented interfaces.

Constructor & Destructor Documentation

◆ FScriptInterface() [1/3]

FScriptInterface::FScriptInterface ( )
default

Default constructor

◆ FScriptInterface() [2/3]

FScriptInterface::FScriptInterface ( UObject InObjectPointer,
void InInterfacePointer 
)
inline

Construction from object and interface

◆ FScriptInterface() [3/3]

FScriptInterface::FScriptInterface ( const FScriptInterface )
default

Copyable

Member Function Documentation

◆ AddReferencedObjects()

void FScriptInterface::AddReferencedObjects ( FReferenceCollector Collector)
inline

◆ GetInterface()

UE_FORCEINLINE_HINT void * FScriptInterface::GetInterface ( ) const
inline

Returns the pointer to the native interface if it is valid

◆ GetObject()

UE_FORCEINLINE_HINT UObject * FScriptInterface::GetObject ( ) const
inline

Returns the ObjectPointer contained by this FScriptInterface

◆ GetObjectRef()

UE_FORCEINLINE_HINT TObjectPtr< UObject > & FScriptInterface::GetObjectRef ( )
inline

Returns the ObjectPointer contained by this FScriptInterface

◆ operator!=()

UE_FORCEINLINE_HINT bool FScriptInterface::operator!= ( const FScriptInterface Other) const
inline

◆ operator=()

FScriptInterface & FScriptInterface::operator= ( const FScriptInterface )
default

◆ operator==()

UE_FORCEINLINE_HINT bool FScriptInterface::operator== ( const FScriptInterface Other) const
inline

Comparison operator, taking a reference to another FScriptInterface

◆ Serialize()

FArchive & FScriptInterface::Serialize ( FArchive Ar,
class UClass InterfaceType 
)
protected

Serialize ScriptInterface

◆ SetInterface()

UE_FORCEINLINE_HINT void FScriptInterface::SetInterface ( void InInterfacePointer)
inline

Sets the value of the InterfacePointer for this FScriptInterface

◆ SetObject()

void FScriptInterface::SetObject ( UObject InObjectPointer)
inline

Sets the value of the ObjectPointer for this FScriptInterface

Friends And Related Symbol Documentation

◆ GetTypeHash

uint32 GetTypeHash ( const FScriptInterface Instance)
friend

The documentation for this class was generated from the following files: