Attaching scripts to objects via editor

Perhaps this is already implemented, and I just haven’t seen it yet, but is it possible to attach scripts (C++) to objects through the editor?

Unity3D has an excellent tool within the GUI that allows users to write a script in VS or MonoDevelop, save it, and it then appears in the browser window within the Unity GUI. From there, you can literally drag and drop that script onto the object in a scene.

Is it possible to have similar functionality in UE4?

Here is an example of it:

http://docs.unity3d.com/Documentation/Images/manual/Inspector-3.jpg

http://docs.unity3d.com/Documentation/Images/manual/Scripting-3.jpg

I would like to add that the major benefit to this is that you can write multiple boilerplate scripts, then attach any number of them to any object in Unity, which is pretty much the only thing I like in that engine. So naturally I would like to know how that could be handled in Rocket!

I agree, that’s exactly why I like it too.

Hi,

This is an area that we’re interested in improving, but we don’t have firm plans yet.

Currently, adding behavior always requires creating a new class (either in C++ or as a blueprint), although that behavior can be encapsulated and mixed in by creating components. You can already create components that work very similarly to Unity behaviors, which look at the actor they’re attached to and search for other components they want to interact with (or just directly interact with the root component of the actor, in the case of simple motion behaviors).

For well structured systems, we generally prefer the code living in the actor class, since you have guaranteed availability and type safety of your added components (no spending the start of the behavior finding or creating any components you need). However, for prototyping and one-offs, being able to quickly mix in without creating a new blueprint is certainly desirable.

Cheers,
Michael Noland

Thanks for the response Michael.

I’m finding that a lot of the functionality I was looking for is already in the editor, albeit a bit hidden at first, through the Blueprint Editor (look at the components and details panes) and the property editor.

Both of which allow me to make changes to the variables stored in the classes without having to constantly rebuild scripts or open Visual Studio.

I’m still diving in a bit more, so I’ll let you know if I come across any other things I’d like to see integrated.