A Physics with Astrophysics graduate and level designer specializing in the Source engine. You can contact me here or by yelling really loud.

Swapping from Unity to Unreal 4 – Pt 2

Anything done per frame for an actor happens in Tick( float DeltaSeconds ), which answers another question from down the line about what Time.deltaTime would be. Ticking can be halted by sending false to SetActorTickEnabled(). Then while ticking is disabled you can manually force a tick with TickActor() (I think). Hoever to get an actor to actually use its tick function, you need to start it off with PrimaryActorTick.bCanEverTick = true; in the constructor.

The UE4 analogue to Unity’s Debug.log() sends messages to the output log which is unhelpfully separate from the message log, but at least they can be tabbed (small victories). More info here.

UE_LOG( LogTemp, Log, TEXT( “debug message” ) );
Or for putting something on the screen, which can be dang useful (Gotta check that GEngine exists first, apparently sometimes it wont and that’ll cause crashes or demons spawning from hell or something):

if ( GEngine ) {GEngine->AddOnScreenDebugMessage( -1, 1.0f, FColor::Yellow, TEXT( “Walking” ) );}

My next issue is getting an actual mesh to spawn. I’m not sure if I want a static mesh actor, or if there’s some other kind of runtime based mesh like source has prop_static and prop_dynamic, or if UE4 simply calls all non-skeletal meshes static. If I do want a static mesh actor, how do I set the mesh of it dynamically?

Leave a Comment