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"

ue4 Line-trace door bug

So I have this pretty strange bug with my doors. In my FPS blueprint I have a linetrace that casts to my door blueprint. I am using a flip flop so when my linetrace hits, one of my values will be 90 degrees and that will rotate the door, but when it hits again, the rot value goes 0 degrees and the door closes.

However, when I open one door, and try to open the other door, it makes the closing door noise and doesn't open. I have to press 'e' again for the linetrace to open it and then the door opens. This is because it's the same blueprint and it thinks it's the same door or something of that sort I think. I don't want to have to use multiple door bp's if possible, so any help would be appreciated. Thanks!!!

Product Version: UE 4.18
Tags:
doorbp1.png (69.8 kB)
doorbp2.png (73.9 kB)
more ▼

asked Apr 09 '18 at 06:35 PM in Blueprint Scripting

avatar image

CardboardmanDan
32 5 8 12

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

1 answer: sort voted first

Hello Dan,

Try this:

Create a custom event inside of your "LinetraceDoor" BP. Put all of that logic in doorbp2.png in the custom event.

Then, after casting to lintracedoor, call the function (aka custom event) on the door (drag from pin "As Linetrace Door")

I think this will solve your problem!

more ▼

answered Apr 09 '18 at 09:58 PM

avatar image

Alex O ♦♦ STAFF
2.8k 5 10 11

avatar image CardboardmanDan Apr 09 '18 at 11:39 PM

Thank you so much, this worked like a charm!

avatar image CardboardmanDan Apr 10 '18 at 04:32 AM

Hey, I don't know if you have the time right now but the doors work great except I have an AI and I made it so that when it enters the box trigger on the door bp, it will open the door, then when it leaves the box trigger, the door closes. I have successfully made this however, when I open the door first myself, the the ai comes and closes it, and I try to open it, the door blueprint thinks that I still have it open and I am closing it even though it's already closes, so it just makes the closing sound and closes.

However, I want to open the door when it's closed by the AI, not close it again. How can I do this? Screenshots will be below, thank you for taking your time to read this! Hope this isn't too much.alt text

alt text

ai-bps.png (86.0 kB)
player-bp.png (80.5 kB)
avatar image Alex O ♦♦ STAFF Apr 10 '18 at 01:28 PM

You're welcome! Thanks for the screen shots. It seems strange to me that you are calling "LinetraceDoor" and your ai is calling "OpenDoor" - each flip/flop node would have it's own state.

Do you have more than one flip/flop in your door BP?

avatar image CardboardmanDan Apr 10 '18 at 05:30 PM

No sir, I only have one flip/flop and it's in the linetrace door function which is in the door BP This is the function for the player to open and close the door which is in the door BP's. I did not share a screenshot of this yet. alt text

avatar image Alex O ♦♦ STAFF Apr 10 '18 at 05:47 PM

So how come the AI is not calling "linetraceDoor" - or is there something inside the AI's "OpenDoor" that casts to/calls "linetraceDoor" on the door?

avatar image CardboardmanDan Apr 11 '18 at 01:30 AM

Hi, I just replaced the open and close door function with line trace door function and it seems to work because of the flip flop except there's another problem now. When the AI enters the box trigger, it calls the linetrace door function and he opens the door, but when he exits the trigger box, it calls the linetrace door function again and that closes it because of the flip flop.

However, if I open the door first, he'll close it when he enters the box trigger because the player and the ai are calling the same function, so I will open door, then flip flop and the AI will close the door.

Also no, there is nothing inside the open door that casts to linetraceDoor. Sorry if I am not making much sense.

avatar image Alex O ♦♦ STAFF Apr 11 '18 at 01:52 PM

Haha, I follow you - Two things that come to mind would be having an "open door" and "close door" function in your door (avoiding flip/flop entirely) the other thing would be adding logic to the door to know to ignore an overlap in certain situations

avatar image CardboardmanDan Apr 11 '18 at 06:28 PM

Okay, so I have the Open and Close door functions that simply open and close the door when the AI enters or exits the box trigger on the door. So you want me to use the open and close door functions for my player as well without a flip flop? How would I go about doing that?

And how would I go about adding logic that would know when to ignore an overlap? I'm sorry if I am asking so many questions but I am not very good with blueprints at all.

avatar image Alex O ♦♦ STAFF Apr 11 '18 at 07:08 PM

Let's just try to keep this on the topic of doors. Casting to a specific actor is a good way to ignore overlaps on most things, but I think the missing key for both of these problems is the use of Booleans/Branch Node. (Use the boolean to turn on/off functionality) Same logic applies for unifying door logic (bIsDoor open -> if true fire closing logic, set bIsDoor open to false)

Run through this playlist to build a solid base for BP knowledge!

https://www.youtube.com/watch?v=EFXMW_UEDco&list=PLZlv_N0_O1gY35ezlSQn1sWOGfh4C7ewO

avatar image CardboardmanDan Apr 12 '18 at 02:32 AM

Thank you so much for all your help! I finally got the doors to work for the player and the AI. The AI can now open doors normally and when the door is already open is doesn't do anything. I did this using branches and bools. So I made it in the linetracedoor function that when the door is open, "IsDoorOpen" is checked, then when it's closed, "IsDoorOpen" is not checked. Then I used a couple branches and got the bool variable and now everything works pretty good! Thanks for all the help!

(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