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"

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.

alt text

Product Version: UE 4.7
Tags:
interactionbp.jpg (270.0 kB)
more ▼

asked Aug 12 '15 at 04:28 AM in Blueprint Scripting

avatar image

DLSoundDesign
1 3 5

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

2 answers: sort voted first

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,

Garrett

more ▼

answered Aug 12 '15 at 09:15 AM

avatar image

Gurb
30 2 5

avatar image DLSoundDesign Aug 12 '15 at 09:31 AM

Hi Garrett, That's exactly it. I can open the top drawer but I can then interact with the bottom drawer through the top one. I basically used a collider coming from the camera to determine when the collision events occur. I have a variable set up for both the top and bottom drawer when they are open/closed. I want to basically send that info to the bottom drawer and when the top one is open disable the collision for the bottom drawer.

The issue I think I'm having is what to put into the casting node.

I thought this may work but it never goes through the cast node (This is on the top drawers blueprint) I have the tick checking for the status of the top drawer. I then want to send that info to the bottom drawer and disable the collision until the top drawer is closed.

This has been driving me insane haha I'm sure im just missing something here.alt text

casting.jpg (230.4 kB)
avatar image erinacea Aug 12 '15 at 05:45 PM

How are your world objects set up?

If both drawers are child objects or referenced somehow by the TeachersDesk object, could you possibly access the TeachersDesk from one of your drawers and from there access the other drawer to disable the collision? Or alternatively, set a boolean on the desk for whether any drawer is currently open, as Gurb suggested, or an integer to keep track of the number of open drawers, and compare against that in your collision check?

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

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.

more ▼

answered Aug 12 '15 at 10:00 AM

avatar image

jtsmith
1.4k 70 29 92

avatar image DLSoundDesign Aug 12 '15 at 10:23 AM

I've set everything else up this way. I had trouble with the Set Render Custom Depth node when using line trace from the character. Seems to keep glowing when you move away from the object.

I have it set up so when you collide the object glows and interaction is enabled, and when you look away (not colliding with object) the glowing stops and you can no longer interact. (This has been working a treat until now) Then when you press 'F' it opens and closes.

That's where the issue arises of being able to trigger the bottom drawer.

This video may give you a better idea of what I mean. https://www.dropbox.com/s/0bn38vh4cwgc68t/2015-08-11%2022.56.25.mp4?dl=0

Thanks for the suggestions so far guys.

(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