Move Object to another object along ONE axis

Fairly simple I think but can’t figure it out.

I have an elevator on the second floor that I’m trying to move down to the first floor.

I get the target world location (where I want it to move to), store it in a variable and use the move to component on the elevator to send it on it’s way. It works fine, but I just want it to move along the z axis only (up and down like an elevator). Right now it’s moving on all 3 axis’. and is going through walls and all that etc.

Yeah I’m aware of the lift tutorial but it uses matinee and that’s not an option for this particular elevator.

Also, on a side note is there a way to change how UE4 handles what direction is up? Up and down assigned to the z axis just looks silly to me. I’ve always been accustomed to Y being up and down.

Anyway, thanks for any help guys.

I don’t know if you can change the way up and down is definied.

The current location of your left and the location of the new position only differ in the z axis?
If yes, could you show me how exactly you move the elevator?

I don’t think there is a way to change the axis of up and down.
As far as I’m aware gravity is hardcoded to Z right now which makes this rather difficult…

Anyway to solve your problem. I’m not entirely sure how exactly you setup your Blueprint but when you save the destination variable you could just get your X and Y from the current actor location and only get the Z axis from your destination location.

You can easily do that by “Break Vector” and “Make Vector” which will break your vector into Floats.

If you’re using Version 4.4 you could also lock your lift Blueprint to one axis inside of the Physics settings in the defaults.

Took some playing around but that was indeed what I had to do. I don’t know why it never occurred to me that I had to grab the x and y location of the target as well. /facepalm

Thanks so much for the help.

Here’s my nodes if anyone is curious.

You were both right, I was ignoring the X and Y values… thinking all I wanted to adjust was Z.

Live and learn I guess!

Thanks for taking the time to help.

No problem (: pls mark the answer that helped you by clicking the “check” mark on the left side of the answer.

PS: Sorry if you already did. Had this question open for 30 min without refreshing.

hey anselm. any chance you could share you whole levator solution, to see, how you solved it?