I have several types of actors, that all should have the ability to flip by 180°. I felt the best way to implement that behaviour, was to create an actor component, that I could add to the different actors. To my dismay I had to find out, that timelines (for whatever reason) do not exist in components. And they can’t be added to macros either. So do I have to duplicate my code over all my actors? Or is there another way to achieve this?
Hi, I had to solve the same problem recently. I ended up using C++ to create timelines for my actor components, this has worked well so far (see this answerhub post for using Timelines in C++). I’m not sure why timelines are disallowed in blueprint actor components.
If you’re looking for a pure-blueprint workaround without duplicating code, favoring inheritance over composition (create a parent say ‘FlippableActor’ and have your actors inherit from this) is the only thing I can think of, although I don’t like that solution. I say just create an actor component in C++ and use your timelines from there unless there’s a good reason not to.
Could you add them to array, run a loop then effect all?
You could do this with iTween. Just set a tween that rotates 180 and fire it when necessary. It will take care of the “timelining” for you.
Thanks for the suggestions. For now I’m going with VSZ’s suggestion to use a common base class. I’m not happy with it, but it’s the easiest way.
Right now I’m not sure, that actor components are useful. There are just too many limitations.
And I really have to try out iTween one of these days.