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"

How do I move an actor within an actor based on the parents orientation?

Hi everyone!

So basically, what I'm trying to do is create a hatch door actor that slides open and closed when triggered that can simply be dropped into the world and works. I've got it to slide open and close along its X axis when triggered via a timeline, the problem is it seems to move the hatch within the actor based on world location, which means if the hatch actor is rotated in the world, instead of sliding to the side, it'll slide skew and out of the frame because its using the X axis of the world, not the parent actor or itself.

Sorry, I know its probably a noob question but I've tried all kinds of things and I'm stumped, thank you in advance! This is what I have so far (within the hatch actor). There's a left piece and a right piece that side apart and together when open and closed. I have it all hooked up to a temporary trigger box for testing and it works, just not when rotated in the world.

alt text

alt text

Product Version: UE 4.12
Tags:
001.jpg (73.0 kB)
002.jpg (104.1 kB)
more ▼

asked Nov 20 '16 at 09:57 PM in Using UE4

avatar image

VortexPrime
3 1 2

avatar image TheAmazingPee Sep 12 '18 at 09:24 PM

Hi!

I'm having this exact same problem with some moving platforms I've created. I have a floor blueprint that randomly spawns with a bridge that moves along the Y-axis. These platforms can spawn at 0, 45, 90, 180 degree orientations but obviously only move correctly when they spawn at 0 degrees. I realised this was because the timeline was relative to the world axis, but I can't find away to change this without creating a different timeline for each orientation and calling in the correct timeline based on the objects orientation on spawn. Is this the only way? Did you manage to find an answer? If so, could you pass it on please? I'd be super grateful :-)

Cheers

Pete

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

its a pretty easy thing to solve, all you need to do is be working local / relative space for the actor. the basic idea is that instead of setting the actor location you want to be setting the location of the components within the actor. the components location is relative to the origin of the actor, so you can set a a components location to say 100uu on the X axis and it will in relation to the actors location instead of potentially ending up across the map. that may not have been explained well but the picture below shows an example.

in the example below the two meshes would be your hatch doors and we are trying to move them apart so they are open. i have the pivot/origin of each mesh at 0 0 0. then i just use a timeline to control the time it takes them to move and the lerp to control the locations they move to and from. the timeline used here is a 0-1 value over 3 seconds. the only other thing to note is the multiplication node which acts to reverse the direction for one hatch since they need to move apart.

Edit: also note that for this to work you do not want the moving object to be the root of the actor.

alt text

capture.png (191.4 kB)
more ▼

answered Sep 12 '18 at 09:56 PM

avatar image

ThompsonN13
10k 33 9 23

avatar image VortexPrime Sep 13 '18 at 06:39 AM

Thank you, much appreciated! :)

(comments are locked)
10|2000 characters needed characters left
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