x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.20
Tags:
more ▼

asked Oct 04 '18 at 12:03 PM in Blueprint Scripting

avatar image

CaddyWompa
1 1 3

avatar image ThompsonN13 Oct 04 '18 at 01:18 PM

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

https://answers.unrealengine.com/questions/834145/view.html

avatar image CaddyWompa Oct 04 '18 at 01:20 PM

yeah sorry dont know how that happened

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The most simple setup would look like this:

alt text

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

alt text

capture.png (93.7 kB)
cap2.png (9.1 kB)
more ▼

answered Oct 04 '18 at 12:31 PM

avatar image

Everynone
13.8k 74 25 58

avatar image CaddyWompa Oct 04 '18 at 01:20 PM

Thanks so much

avatar image CaddyWompa Oct 04 '18 at 01:41 PM

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)

avatar image Everynone Oct 04 '18 at 01:49 PM

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

avatar image CaddyWompa Oct 04 '18 at 02:13 PM

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

avatar image Everynone Oct 04 '18 at 02:54 PM

It does not come up for you when you search?

alt text

untitled.png (32.4 kB)
avatar image CaddyWompa Oct 04 '18 at 02:59 PM

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

avatar image Everynone Oct 04 '18 at 03:08 PM

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! :D

avatar image CaddyWompa Oct 04 '18 at 03:14 PM

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.

avatar image CaddyWompa Oct 04 '18 at 03:14 PM

aha, no not a tank XD

avatar image CaddyWompa Oct 04 '18 at 03:22 PM

alt text 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.

nodes.png (257.6 kB)
avatar image Everynone Oct 04 '18 at 03:39 PM

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:

alt text

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 work.

capture.png (75.0 kB)
avatar image CaddyWompa Oct 05 '18 at 07:42 AM

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)

avatar image CaddyWompa Oct 05 '18 at 07:48 AM

180 sorry.

avatar image CaddyWompa Oct 05 '18 at 07:51 AM

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

position.png (133.3 kB)
avatar image Everynone Oct 05 '18 at 07:56 AM

Once it's attached set relative location only.

avatar image CaddyWompa Oct 05 '18 at 08:02 AM

hum is that with the pivot centered?

avatar image Everynone Oct 05 '18 at 08:05 AM

Ideally, yes. If you have an offset pivot already, you'll need to account for that, too.

avatar image Everynone Oct 05 '18 at 08:16 AM

Just in case, so we're on the same page:

alt text

Image from Gyazo

capture.png (215.6 kB)
avatar image CaddyWompa Oct 05 '18 at 10:08 AM

Hi thanks, I figured it out in the end. One last thing what does it mean in the world outliner when an object has an orange circle? I have a line trace by channel node and it only works for objects without the orange dot, any ideas?

Thanks.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question