How do I teleport characters in a marked area to two seperate locations with two seperate inputs.

I am working on a school project and can not seem to figure this out. I am a noob with UE4 but am using it for Architecture research and using the VIVE

I am trying to set up several different rooms
Think of this as location 1, location 2, and location 3

I want the person to be able to press the R trigger within a set area (Location 1) and teleport (change the position) to a marked area (Location 2). These Inputs should only be valid in the marked areas as well .

When I say marked area the location will be indicated by a physical element and text popups (I know how to make these)

I followed this video Teleportation | Tutorial | Unreal Engine 4 Blueprints - YouTube
And learned how to make the R Trigger initiate teleport that the character would teleport from location 1 to location 2 but my trouble comes in with the next option.

I want the Left Trigger to take the person back to location 1 when pressed in the marked area for Location 2

When you are at location 1 R Trigger Sends you to location 2

When you are at location 2 R trigger Sends you to location 3
L Trigger Sends you to location 1

When you are at Location 3 L Trigger Sends to Location 2

The plan is to add more locations so the sequence will be character moves to marked location, Text pops up , press R trigger to move to the next location, Press L Trigger to move to the previous location. The first can only have R and last only L.

Any help would be greatly appreciated.

if you have a known number of rooms then its pretty easy to do just make an array of the rooms. then on r input get current room number add one and get that that room number and set actor location.

Rooms probably is not the correct way of terming it for this program as room to me is 4 walls. The rooms I am making are closed in spaces in which the person will explore yet I am seeing the program sees Rooms as something completely different so I apologize on the lack of knowledge. Is it easy to determine what is a room and what is not? A quick search yielded nothing for me.

Here is an example of what I am trying to do. There are 4 rooms (the area defined by the walls) 4 chairs the location of teleportation. Far left will be 1, far right is 4.

it is quite difficult to understand what your saying. i would loosely define a room as a enclosed space. but it really doesnt matter what the room is the way i wrote the above script “rooms” is just an array of actors, so it could be whatever you like. they are essentially being used as a marker to tell where to teleport to.

oooh I looked at the script and was thinking you could define certain areas as rooms and then that would used for that script. Sorry for the miscommunication I will try that way! Thanks alot!

in your case you could using the script i made you could use the chairs as the actors in the array and whenever you pressed R it would take you to the next chair on the list. or you could use something like target points if you wished.

I just have one question to clarrify the script, What would I be trying to add within the script to get the 3 pieces connected with the green line from Current Room, the middle connector with 2 lines off it towards the right, and Set.

which nodes are you talking about? i assume you are talking about the add and subtract nodes which to get just drag off current room and either put in a + or - sign. the only other one not labeled is the “greater than or equal to” (<= on it) node this one just type < into the search. if its not one of those ones let me know.

I circled the ones I am asking about and added what mine is looking like. I was able to get the + and - sign as well as “greater than or equal to”. My array does not look like yours so I may be missing a step, and for the one I circled with SET in it I could not find it. Thanks for all your help by the way!, sorry for the communication issues.

ok i see now. the current room node is a variable i created in the blueprint of type integer. the rooms node is a variable as well but it is an array and its type is actor. to get those two nodes you first need to create the variables. to create variables look on the left side of your screen and you will see a scetion called variables just click the plus sign on that tab and it will create a variable, then with the variable selected in the panel on the left you can modify it in the details panel on the right. the two show thus far are get nodes. to get those drag the variable onto the graph and a window will popup asking if you want to get or set, select get. the last node is a set node for current room, to get this one drag the current room variable to the graph but unlike before when the window pops up select set. you could also right click the graph and type in set current room to get the same result.

dont worry about the communication as long as it works out right. you may just have to answer an extra question once in awhile

Thanks a ton I got it to work! Is there a simple way I can now add to the script to have the trigger only work within a set trigger box. I know how to do this for turning on lights, causing movement of other objects like opening doors through a blueprint class but have not been able to figure out how to add it to scripts on level blueprints such as this one.

you dont actually need to have it on the level blueprint, when i made it i made it as an actor. but basically when you enter the trigger box (beginoverlap) you would set a variable of type bool to true and when you leave the trigger box (end overlap) you set the variable to false. you would then have a branch just after the the R and L input with the bool condition dependent on the variable.