UE4 How to make an actor that can Tick In the Editor

UE4 How to make an actor that can Tick In the Editor

Why not use an Editor Utility Actor?

Editor Utility Actors don’t quite get you the exact functionality that seems useful enough for ticking in the editor via an actor. It will tick in the preview windows of blueprint and potentially lead to lots of head scratching as you realize that the blueprint you were working on is logging when you are trying to use it in other places. Also, there are times where you actually do want the same actor runtime as well (It’s rare but totally a valid case).

The Solve.. Make your own actor class!

In your custom actor class you can use this to add a bool that toggles being able to tick in the editor. This way whenever you need this you can just simply check it on and get going. It also is separated so that you can have different logic happen in the editor vs in-game. Most of the time I end up with 1-1 anyway but its nice to have the option.

header file

/** Allows Tick To happen in the editor viewport*/
virtual bool ShouldTickIfViewportsOnly() const override;

UPROPERTY(BlueprintReadWrite, EditAnywhere)
bool UseEditorTick = false;

/** Tick that runs ONLY in the editor viewport.*/
UFUNCTION(BlueprintImplementableEvent, CallInEditor, Category = "Events")
void BlueprintEditorTick(float DeltaTime);

cpp file

// Separated Tick functionality and making sure that it truly can only happen in the editor. 
//Might be a bit overkill but you can easily consolidate if you'd like. 
void YourActor::Tick(float DeltaTime)
	if (GetWorld() != nullptr && GetWorld()->WorldType == EWorldType::Editor)

// This ultimately is what controls whether or not it can even tick at all in the editor view port. 
//But, it is EVERY view port so it still needs to be blocked from preview windows and junk.
bool YourActor::ShouldTickIfViewportsOnly() const
	if (GetWorld() != nullptr && GetWorld()->WorldType == EWorldType::Editor && UseEditorTick)
		return true;
		return false;

Then when you are done you should be able to add the new BlueprintEditorTick to your event graph and get rolling!

Final Notes

This is pretty dangerous if you aren’t mindful with what nodes you use in here. Try not to do things like Add Component or any other nodes that would spawn objects into the world or if you do make sure you store them and clean them up. Delays might work but they could be a bit odd as well. Just be aware that it can be fragile at times so make sure to give unreal some cake beforehand… ❤️

Implementing Undo in UE4 Editor Utility Widgets and Blueprints

Implementing Undo in UE4 Editor Utility Widgets and Blueprints

This image shows an example of how to setup an undo-able function call in unreal 4’s blueprints. This was reported as a bug and marked “by design” simply because you can do it 100% controllable and custom in blueprints

Begin Transaction

Starts the undo stack and allows for anything after this call to be grouped into 1 undo operation.

Transact Object

Every object you want to be undo-able has to be added by using the Transact Object node. Then you can do whatever you want to the object and it will properly go back to whatever it was before doing anything to that object.

End Transaction

Closes the gates and stops recording anything else to the undo stack. Which then will allow you to finally undo properly you custom tool’s operation.

This was a bit tricky to find since typing the word “Undo” in blueprint doesn’t give you much. Under the hood though everything undo-based is actually referred to as the Transaction System. Which is why these nodes are called Transaction Nodes.

That is all, hope this helps and Have a great day!

Project Mix: Fireworks Test

Project Mix: Fireworks Test

150 Nodes all playing respectively to their connection timings.

So, I had an idea. I wanted to make fireworks as a way to celebrate the 4th of july. And I figured lets try to do it with project mix.

What you see in the video is 150 Connected nodes. Each node has their own note and sound settings.

What a node looks like up close
The looks of the actual sound settings

All of these are defined by presets in which I manually create by importing a wav file from FL-studio with each octave I want to have available to use. Like I’ve talked about in the past with the post about audio visualization using the baked analysis that unreal just added, there are only a handful of actual sound files which makes my life so much easier when it comes to quick importing and management. However, I don’t currently have support for just.. One-Shot type sounds.

FL-studio midi used for exporting sounds.

I tried to take an approach to create this that is a bit additive. I started with the basic kick to get the loop that I wanted to use, layered in the snares and high hats, and then went to town emulating the “firework” feel I was going for. This meant that I needed to create a few buttons to help make things faster like Randomize Notes, Randomly place in a spherical pattern, and selection helpers.

The buttons at the top are the examples of added usability.
In the end… it looks like this hellstorm of madness. There’s gotta be a better way.

Right now there is NO MIXING setup at all. This is about as raw as audio playback can get in unreal. Just play the damn sound… This is also why certain parts might sound a bit too loud or soft. So the next phase of development for this system is pretty clear. Project Mix.. needs.. well.. a MIX of some sort. But that’s not the most worrying thing to me. I think the biggest issue with development right now is that I have to hit play.. wait for the loop to start… and hope that it sounds the way I want. This makes things extremely slow and aggravating to work with. So, I think I am gonna take an interesting step forward into editor-based nodes that actually play .. while I am tweaking them (Obviously with some control on when to play). Imagine kinda like planet coaster, where the roller-coaster is running along the track you are currently building. This is something that I think is needed in order to not rip my hair out creating the next scene and ultimately.. the final vision for this project ( Which I am currently keeping to myself ).

Then… well there is the time synth.. which aims to solve all of my synchronization problems… so I gotta get going on that too. I did watch dan’s amazing overview of it and I think it has a ton of potential with one fatal flaw… time synth components are made to not be used spatially… 150 times in a scene. Therefore.. I’d have to tell the nodes to call the master time synth in order to play things on time efficiently. Maybe if I do that I can convince the awesome audio folks to help me out with getting 3D sound to work properly per node.

So to finish it off.. here is a few bullet points for the future.

  • Better Editor Development workflow
  • An actual soundclass and submix setup.
  • Update the core audio system to use the time synth component instead of my jenky synchronization master blueprint.

Those three are enough to keep me busy for awhile. On that note, have a great day <3

Watch what you eat! 15 min a day 018-032

Watch what you eat! 15 min a day 018-032

Ok, this is the format! I am done with the daily edits of the videos for now. Timelapses it is simply because it takes too damn long to edit stuff. Maybe if I’ll give it a go again one day if I ever get premiere to not take years to export a file. Anyhow, I am pretty happy with how this one turned out. On of my friends said that it looked like a skull with tangerines as eyeballs.. which is funny because I had a similar vibe when making it to call it something like “Watch what you eat”. So that is what I am running with.

I have made a habit

I have to draw at least 15 minutes a day now or else I feel almost guilty. I’ve had 1 slip up but recovered the time later in the week and to be fair, I was traveling that day so that is how i justify it! Moving forward, I have some Ideas that I want to start trying which can start to intertwine possibly with the album. “I’ve got some wild ideas” but I am not as secure about music as I am art so I tend to not talk about it much but that is still going at a decent rate!

That is it for now. Have a great day!

Dark Lightning!

Dark Lightning!

This is the second piece I’ve finished on day 017 in my 15 minutes a day journey. If you have no idea what that is please check out this post.

Each time I finish a piece I am naturally left to reflect on what I could improve during this process. Here is where my head is at right now.

  • Instagram posts are working pretty nicely. I think instagram is built really well for this.
  • Twitter has 1 or 2 days that seem to stand out, so it might be best to try and keep only released stuff like this post on twitter.
  • Facebook can just take literally everything
  • Youtube … the videos are flood filling my youtube account.. and I don’t think i like that. So my current thinking is to take the current smaller video format and condense the entire piece into a longer video that you can watch from A-B that has a bit more story than the timelapse. I like being able to share some of the thought process as I move forward so I think this will get better and better the more and more I talk through what I am actually doing. Slowly but surely… so you can expect that I will delete or unlist almost every daily type video on youtube and keep the posts to only released content. I think this is best moving forward to keep people interested and actually give them a chance to watch through something. Can you tell this has been bugging me?

So, I think overall that is my current thinking and the overall goal still remains the same just with a few tweaks to how I go about showing the journey and progress.

Have a great day! <3