How do I move an actor within an actor based on the parents orientation?
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.
asked Nov 20 '16 at 09:57 PM in Using UE4
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here