C++ animate UObject with Sequencer

I would like to animate some properties of a UObject based object using sequencer. I am doing it with c++ and blueprints - creating possessable, binding object and creating track/section/keyframes with c++.

If the object is based on Actor - it works, but it it’s based on UObject, then it does not.

I suspect it might be something related to the thing that Actors get spawned in world, but my UObject is Constructed from class (I’m instantiating them in blueprints and both are referenced by another actor which is in the world).

Edit:

I tried adding UObject as a property of an actor, binding the actor to posessable and animating UObject property as “myobject.property” , but when doing this, this makes object invalid as soon as sequence player gets created and everything crashes when trying to access my object..

Any ideas or pointers would be greatly appreciated!

Thanks,

Gatis

Hi,

We do expect bindings to be actors, and exist in levels, so direct UObject based bindings won’t work.

You can create an actor wrapper for your object, but to expose the parameters of the object to the sequence you’d need to add duplicate variables to the actor. Sequencer won’t be able to directly access the object’s parameters, so the actor will need to act as a intermediary, and set the object’s values when its own values change. This cane be done with setter functions.

This knowledge base article goes into details on using setter functions with sequencer. You’ll need a matching variable and setter function on the actor for each variable you want to expose from the object. The actor will then set its own variable and the object’s variable in the setter function.

Thanks!

Thank you for clarification!

Gatis