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"

Sliding Door 2D Blueprints Help

Hello. I am creating a level where the player must slide a door from one location to another, but I have no idea how to do the blueprint scripting for this. Below is a screenshot of the level.alt text

Ideally, the player would enter a trigger box that the sliding door has, and then they press or hold a button, and move left or right to slide the door. I have tried playing with attach to actor, but the door teleports when the player looks in the opposite direction. The movement of the door should be constrained to left and right.

Any help with this would be much appreciated.

Product Version: UE 4.13
pushdoor.png (343.8 kB)
more ▼

asked Oct 08 '16 at 12:05 PM in Blueprint Scripting

avatar image

7 4 6 9

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

1 answer: sort voted first

Hi CarlGoodman,

Ive had a quick stab at this issue, and I came up with a solution, its probably by no means the best solution, but it should help you get what you want. I did it in the 1st Person Example map so it also might have a bit of a different setup than what you need, heres a small video of my solution, if thats what you are looking for, then great - https://www.youtube.com/watch?v=vYUEHiz8NgU&feature=youtu.be

So the first thing I did was set up a 'Door' blueprint. That is a cube with a box collision attached. I created two events which set a variable on the player character to true when overlap, and false when not overlapping.

alt text

The next part in the Door blueprint was a Event Tick, which if a variable is set, it goes to a SetActorLocation node. That node is plugged into a make vector, and seeing in your picture that you want your door to move on the Y axis, then I make a FInterpTo node to try and smooth the transition and put that into the make vector. You can see the rest of the setup there, including the two custom events MoveDoor and StopMovingDoor which are called from the player.

alt text

The last part is the player character, this is pretty self explanatory, when you are in the range and the CanOpenDoor is set you get all the overlapping door, and then call the event to move the door, which is needed as the door needs to have the location of the player so it can move towards it. And then the rest of it should be simple to set up.

alt text

Hopefully that will help you, let me know if you need further help.



door2.png (76.1 kB)
door1.png (177.7 kB)
door3.png (156.5 kB)
more ▼

answered Oct 08 '16 at 08:06 PM

avatar image

251 7 3 11

(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