Setting the position and angle of an actor to that of another actor

Hi there, just starting out so sorry for the dumb question. Just wondering why this simple set up won’t work. I am trying to set the angle and position of the cylinder to that of the cube always.

Thanks for the help.

The most simple setup would look like this:

But perhaps you simply want to attach the cylinder to the cube, in that case you’d need no nodes whatsoever:

255596-cap2.png

It does not come up for you when you search?

you asked this same question twice. please dont spam your questions

yeah sorry dont know how that happened

Thanks so much

Ok so with this node setup how would I make the location of the cylinder start at the cylinders pivot (which i have set to the end of the object, not the centre)

You can query objects for their relative location if they’re offset.

Hi sorry, how would that be done? Like changing the get world location to relative location?

yep, but how do I connect the transform data type to the set location and rotation node?

You can just get relative location, you do not need to fetch the transform. You can, of course, get transform and either break it into its elements or right click its pin and split the struct.

It would be easier if you just told us what you’re trying to do. Sounds like something simple but you’re going about it the hard way. I might be wrong, though.

Wild guess: you’re making a tank! :smiley:

Hi, thanks. I have a static mesh that I want to be picked up by the character and then be attached to them. I have done this, however, the static mesh attaches itself from its center instead of its pivot in which I moved to one side of the static mesh.

aha, no not a tank XD

Here is what i have currently, sorry for the mess. All i need is targets new location (guessing not rotation) to be starting from the pivot of the lazercube.

Hi, thanks. I have a static mesh that
I want to be picked up by the
character and then be attached to
them.

There is a much, much better method than manually setting position during tick. You can dynamically attach and detach objects. Experiment with those:

If you’ve set an arbitrary pivot in an external modelling application, I’m not so sure whether UE4 can tap into that. But if you know the value, you can offset it manually. It’s generally more convenient to keep pivot at the centre of the object and move in in UE4.

Also, if you’re serious about attaching things, consider looking at how [sockets][2] work.

Hi thanks, I found the easiest option is the attachtoactor node with a target of the cylinder and parent actor of the first person character. So with this setup, how would I edit the position (i would like to rotate the cylinder 360 and translate it 200 or so in the direction the play is looking)

180 sorry.

This is what I have for the old setup, it works for rotation just not sure how to do it for position.

Once it’s attached set relative location only.

hum is that with the pivot centered?