Download

Derive Interface Implementation

I’m trying to derive an implementation for an interface that other classes can use throughout the system:

IFoo* MyInterface= new ConcreateObject();

I initially set this in the game instance class as a public property.
Accessing this in another class, say BeginPlay() of a PlayerController, gives me a violation.

GetGameInstance()->MyInterface->DoSomething();

Is this even possible and if so is there a place to store the implementation for further use?

Well of course after i post this i’d get it working.

Set MyInterface as a replicated property and the pointer persists.

I’m curious if this is a good idea (Replicating the Implementation) or if it would be better to turn off replication and store this value in game state. Still learning :slight_smile: