Casting Between Two Class BP
So I've been having a lot of trouble getting this working. I have a desk with two drawers in it. (Each with their own separate BP using a timeline to open and close them) I have a box collision set up on the front of both drawers. When the player looks at it they are able to open the drawers and this all works fine. My issue is when the top drawer is open the player is able to still open the bottom drawer because they are colliding with the bottom drawer through the top one.
Is there a simple thing I'm missing in order to be able to disable the bottom drawers BP when the top drawer is open?
Casting never seems to work for me.
I have this set-up for both drawers and then a simple key event to timeline to open them. Any help would be greatly appreciated.
asked Aug 12 '15 at 04:28 AM in Blueprint Scripting
From my understanding, you are able to open the top drawer by itself, then are able to open the bottom one after correct?
If so, I would imagine you could use a boolean to check if a drawer is already open. Once one drawer is opened, another can't be opened till that drawer is closed.
However, if you are opening both at the same time, you could use a flip flop to have it toggle between the two starting with the top drawer.
Im not sure the code you have for detecting which you are looking at, so I can't suggest anything further than this.
Hope it helps,
answered Aug 12 '15 at 09:15 AM
Is it important in your setup to have them as collisions? If not then why not make it a button interaction and when the button is pressed you use a line trace to open that drawer? Using a line trace it returns the first hit actor and therefore will never go through the top drawer and open the bottom one. Only way bottom one would open is if you were looking directly at it and pushing the button.
answered Aug 12 '15 at 10:00 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here