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"

Teleporting after pressing a button

So! I'm making a side scroller game where your playable character teleports to a new place on the same level by pressing a button. For example, when you're on the 1st floor and you need to get to the 2nd floor, you come to the stairs and then the text "press "E" to go upstairs" appears. I managed to make an interactive button, but I have no idea how to make it teleport your character.

That's the button blueprint

alt text

And that's the level blueprint. I know I have to do something with this one, but what exactly?

alt text

Product Version: UE 4.15
Tags:
help1.png (145.4 kB)
help2.png (51.0 kB)
more ▼

asked Mar 28 '17 at 01:36 PM in Blueprint Scripting

avatar image

FoxCommander
3 1 2 3

avatar image Klateralus Mar 28 '17 at 01:42 PM

Try something like this

alt text

avatar image Klateralus Mar 28 '17 at 01:47 PM

or this

alt text

avatar image FoxCommander Mar 28 '17 at 02:14 PM

Thank you! I think I understand how it works, but how can I "combine" two buttons to interact with each other? There are two buttons that are responsible for teleportong from one floor to another - button_2 and button_3

alt text

ds.png (483.5 kB)
avatar image Klateralus Mar 29 '17 at 07:44 AM

Hello, again! You ask me for the answer about particular case but I think it will be better if you'll read this documentation about Blueprints Communication

And read this little tutorial about Blueprints too

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

It seems like you are pretty new to all of this, so i would suggest a simple solution. First of all, no need to do that branch for Trig. simply BeginOverlap should connect to what is currently connected to the branch's True, and the EndOverlap to the branch's False. Now, for each button that suppose to teleport you to X location, do the following:

  1. Drag a Target Point to the location you wish to teleport player to when the button is pressed.

  2. In your Button actor, create a variable called "TargetLocation" of type "Target Point" and make sure its exposed.

  3. In the editor, click the Button actor and use the Eyedropper to pick the Target Point you wish to correspond to that button.

  4. To your event dispatcher (buttontrue) add a parameter called "TeleportTo" of type "Target Point".

  5. In the level blueprint, drag a Get Player Character and do SetActorLocation from it. Then, connect buttontrue to that SetActorLocation and the location to set should be the Target Point's location (the one coming out from buttontrue).

Thats it :) each time the player presses the button, the button will tell level blueprint to teleport Player Character to it's corresponding target point.

Hope this helps

more ▼

answered Mar 29 '17 at 08:18 AM

avatar image

DDraiman1990
156 4 5 8

avatar image FoxCommander Mar 29 '17 at 11:26 AM

This works perfectly! Thank you! You just saved my university project :D

avatar image DDraiman1990 Mar 29 '17 at 11:36 AM

You are so very welcome. Good luck

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