-
Notifications
You must be signed in to change notification settings - Fork 22
Creating a Script Component Blueprint
Vadim Macagon edited this page Nov 29, 2015
·
3 revisions
This page needs screenshots and a fair bit of refinement.
- From the Content Browser menu select Add New->Blueprints->Klawr Blueprint.
- Enter a name for the new Blueprint, e.g. CowHealthComponent
- Select a previously created C# script component type from the tree, or create a new one. To create a new C# script component type:
- Press the Create New Script Type button.
- Enter the filename for your new C# script, this will default to the name of the Blueprint.
- Enter the location for your new C# script, this is relative to the game project directory, and should be outside the Content directory. The default is the Scripts directory (will be created if it doesn't already exist), but you can also set the location to the Source directory (if your project has one), or Source\Scripts, or any directory within the aforementioned directories (excluding Content).
- Press OK to create the Blueprint.
- The C# scripts assembly will be rebuilt and reloaded, you can then select the C# script component from the script types tree.
- Press the OK button to create the Blueprint.
- The new Blueprint script component can now be attached to an actor, just open or create an actor Blueprint and add your Blueprint component to it on the Components page.
- You can now edit the C# source for you script component and UnrealEd will rebuild and reload your component shortly after it detects changes to the source. (This should be documented)
- Drag and drop the actor Blueprint into the scene and launch PIE, the TickComponent() method in your C# script component class will be invoked every time the component is ticked.