ULevelScriptActor, what has OnRemoveFromWorld been replaced by in 4.2

/** Called when this actor is in a level which is being removed from the world (e.g. my level is getting UWorld::RemoveFromWorld called on it) */
virtual void OnRemoveFromWorld() OVERRIDE;

this no longer exists!

What is it replaced by?

Hi ,

I tracked down where OnRemoveFromWorld() was being called in 4.1.1, and it appears to have been replaced with EndPlay(). Relevant code below…

4.1.1

Actor.h

/** Called when this actor is in a level which is being removed from the world (e.g. my level is getting UWorld::RemoveFromWorld called on it) */
	virtual void OnRemoveFromWorld();

World.h

/** 
	 * Dissociates the passed in level from the world. The removal is blocking.
	 *
	 * @param Level			Level object we should remove
	 */
	void RemoveFromWorld( ULevel* Level );

World.cpp

...
Actor->OnRemoveFromWorld();
...

4.2.0

Actor.h

/** Called whenever this actor is being removed from a level */
	virtual void EndPlay(const EEndPlayReason::Type EndPlayReason);

World.h

/** 
	 * Dissociates the passed in level from the world. The removal is blocking.
	 *
	 * @param Level			Level object we should remove
	 */
	void RemoveFromWorld( ULevel* Level );

World.cpp

...
Actor->EndPlay(EEndPlayReason::RemovedFromWorld);
...

#Thank You !

Woohoo!

Thank you so much for doing this research for me !

That worked perfectly!

That really helped me out!

Thanks again!

2537-rainbow.jpg