How to 'start' or 'play' a curve asset in C++
Hello all! I was wondering how it would be possible to start a curve asset in C++. Thanks!
asked Mar 16 '16 at 03:40 AM in C++ Programming
Zip attached with code - you'd need to replace the Errorf with a standard UE_LOG and change headers to use in your project.
Here's a little wrapper:
[Edit] Will attach blueprint image in a second, just upgraded to the latest preview and building new shaders.... [Edit2] Here's the blueprint - You could set this up in a simpler fashion, in my case I wanted to allow blueprints to be able to choose different curves for the C++ to use based on their author's logic. I would assume you could place a spline directly in an actor as a UPROPERTY.
Probably a better way to do this but I created a curve actor type with functions grabbing length, position or tangent at time.
These functions are tagged blueprintimplementableevent and implemented in blueprint.
In my case these actors register themselves in a c++ map in begin play (and remove themselves in endplay) allowing c++ to find an editor authored curve by name. This allows for curves streaming in/out with levels.
Clunky but works, didn't take too long to implement.
answered Mar 16 '16 at 02:32 PM
I've been using blueprints since version 4.4ish. A couple of early engine updates needed some rework but overall they've been usable and stable. You can write some fairly complex things in them and overall the power of unreal comes from combining blueprints and the editor for data editing with c++ where needed for either behavior or performance.
The butterfly class is a custom class of mine that I snipped bits of to demonstrate. My prior lost example was more obviously named :(
Given the concepts you're wondering about my advice is to follow tutorials. There are basic tutorials for placing actors in the world, attaching blueprint behaviors and creating custom c++ classes to further develop behaviors. A few hours spent following these tutorials and exploring the example content provided in the engine will give you a more solid understanding of the engine to build on before you try implementing something of your own.
Topics to look at:
answered Mar 18 '16 at 05:39 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here