I’ve got an actor with a SpriteComponent. Is there a way I can set up that component so I can change its relative location by dragging it around using the editor’s transform tools?
Hi Cedric,
A method for doing that would be to use a Vector with your Sprite component. If you make a Vector variable with Editable and Show 3D Widget checked, you can use that information to move your Sprite component in the level. After making the Vector, go into the construction script and execute “Set Relative Location” with your Sprite as the target (you will have to uncheck “Show user-created variables only”) and the Vector as the new location. Now when you place the Blueprint in the level, you will have a widget appear with your Sprite that you can move and the Sprite will move with it. Please let me know if this helps.
Cheers!
Alexander
Hi Alexander, thanks for the reply.
I know about this technique, but my actual question was is it possible to do something similar without using blueprints?
Hi Cedric,
Unfortunately, you cannot do that at this time. You would have to make your actor a BluePrint class, then use the method I had originally posted. An alternative would be to wrap the sprite in an actor to move it, but the root would go with it, not just the component. Please let me know if there is anything else I can do for you.
Cheers!
Alexander
Wrapping the sprite in another actor would be a viable solution, but I’d need a way to make it notify another actor of its transform changes (still through C++).
Hi Cedric,
You should be able to use any of the typical actor->actor communication avenues in this case (e.g. “base” actor holds a ref to the sprite actor and queries it for position). With Beta6, this should be easier since Blueprinted actors can talk directly to each other now.
Cheers!
Jeff