I have am having major difficulty understanding why my Blueprint is not working correctly. It does what I am asking it to do:
-Recognize distance between floors
-Set Elevator location to Elevator Stop Bulletins back and forth as a Event Tick to test functionality
-Not fly into space and disappear forever
The problem I am facing is that when it arrives at it’s destination the location values seem to be stuttering and making the elevator do this strange jitter when it arrives. I don’t understand in the slightest what could be causing this or how to fix it. Any advice for this beginner?
Please note, I am not wanting to use Level Blueprints, or Matinee. Just FYI. I want a self contained Blueprint for an Elevator that is functional.
I attached a picture of my Blueprint, so hopefully someone can diagnose.
create array of vectors, this will hold relative locations of all floors (for now just 2 for both ends). Check that property that tells to show widget in 3d space for values of array. Now you have easy way to move those points in editor without typing in vector values.
when you have that array working, create variable (float) that determines direction. It should be +1 or -1.
then you need to have 2 another variables that lets say are: “elevator floor delay”, “arrival time”
you also need boolean variable that tells blueprint if elevator should move.
Now lets construct whole elevator bp:
in begin play of elevator, set “arrival time” to “game delta seconds” - “elevator floor delay” so elevator is ready to move at beginning of game.
also in begin play, set relative location of elevator mesh to first element from vector array. And set direction to +1
Now on event tick of elevator blueprint:
check if that boolean to move is true, if not exit whole thing
if its set to move, check this “game time seconds” > “arrival time” + “elevator floor delay”, exit if its not more than this (use game time seconds for delays not delta time from event tick)
now your elevator will move only if it waited “elevator floor delay” in seconds and you let it move by setting boolean to true or other way around depending on direction
and then interpto from vector [0] to vector[1] or other way around depending on direction.
For your picture i think there is some mess with floor 1 and floor 2 booleans. They flip flop when elevators arrives.
I think mine version has simpler logic for floors, and can be extended to multiple floors later.
Nawrot, You’re awesome for taking the time to try to help out here, thanks!
Currently working on it, so if I figure any of these out, I will update.
Okay, so I am trying to do the elevator you have suggested (added a key input to be activated in a box collision), but I am having issues with the movement.
-Elevator is snapping directly from position 1 to position 2 without any type of smooth transition. How do I get a smooth, adjustable transition time/animation?
-How do I get the elevator to use the direction variable?
Your technique is INFINITELY less complex and easy for me to understand, so that is why I am coming to you for a follow up. Your brain seems to think smarter than mine. Ha.
I attached a picture of the progress. Hopefully it’s what you were talking about.
Thanks!
-Ivy
Mhousse1247, I will definitely check it out, thanks!
Thank you so much for y’all’s help. I appreciate it. They each helped me come up with a satisfactory elevator. I believe it is actually pretty awesome.
-Determines which floor it is on
-For now, understands that different keys represent different floors and knows how to get there
-Smooth transition without any bugs
-Disables player input until timeline is complete
-etc
I’m going to move on to create doors that are typical to an elevator.
Only issue I have is not being able to adjust the timing of the timeline. It is set to 10 secs right now and that will remain constant even if you are traveling from floor 1 to floor 100 or from floor 1 to floor 2. Any suggestions on how to fix this?
Image attached is my finalized elevator Blueprint.
Couldn’t you use another array of floats to put different travel times on the elevator movement? I’m trying to do this exact thing but this seems like i’ll have to test it out to see if it still works, should and i could keep going on other parts of the level design i want to do!