Opening door via raycast

Hello I am trying to open a door using the physics pickup system from the content physics map example. It sucessfully triggers the open door event and casts to my test door. The problem I am having is that when I am not looking at the door or miles away from it I can still open and close this door even though my raycasts are not hitting it. What is going on here and how can I fix it. I have tried using bools to solve my problem but I am not having much sucess. My door blueprint receives the custom event OK.

Thanks in advance

Which traces are you running? If you are doing a single line trace for object you should be able to “ignore actor” and ignore the door. If you need the raycast to affect the door but only within a certain range use a trigger volume to change the ignore status of the door when within range and set it back to ignore when no longer in range.

Thank you for your help. I am using single line trace by channel and I am checking for hit objects using “actor has tag” I have set up a trigger volume to enable/disable input but once the door is used once I no longer have to look at the door to open it. I can look at the floor and it will still open. The blueprint has a tag of door and I have disabled the visibility blocking profile of the trigger box to ignore so technically the door should not work unless I look at the SM but that isn’t the case.

If you have other objects in between you and the door, does the raycast still hit it or is it blocked?

No its blocked

try doing an on component overlap specifically looking for your capsule component instead of just an on overlap for your trigger volume. I think the raycast may be counting as a part of your mesh, which would explain why it is being accepted and opening the door.

Shouldn’t Toggle Door target be Hit Actor casted to your door class?

Thanks for your help guys I will try those suggestions when I get back and let you know the outcome.

Yes it is casted through my custom function.

Not sure how to do that . Could you explain. I think its the same problem that you mentioned. If I remove the overlap enable input trigger I can use the door from anywhere once first hit open door has happened if you see what I mean. How is the raycast is not being taken into account on the subsequent next activations of the door?

Could you show your trace function? What do you return if raycast doesn’t hit anything?

Hi ,

In your door trigger volume, select the volume you are using. Then in the event graph, right click and type in “On Component”, a node called an on component begin overlap should pop up. Then use the “other component” node to cast to the player character. Drag off of the “as player character” output pin and create an == boolean node. Place the “other component” from your oncomponentoverlap event into the == boolean. Finally, create a branch after your cast thats input is the == node. It should look something like this:

Think I may be narrowing it down. It would appear that my raycast is not forgetting the last thing it was doing. I have used the pickup system as stated above. However I have added to it. When I pick something up it will disable all combat possibilities, however when I have dropped the item and press E again it still disables combat functions. But if I press E on a door the combat problem clears but the door then becomes the constant function target. Man I’m so screwed my head hurts trying to figure all this out. Not sure where to start with this problem :frowning:

thanks again for your help. However if I look at the floor or away from the Door SM it still responds. Think Im gunna rebuild my physics gun and door again. I think there is a bug in it somewhere as described above.

Hi ,

Please post here if you manage to find reproducible steps for your error. I would be happy to recreate it on my end and see if it is a bug.

Hi ,

We have not heard from you in quite some time. I am marking this thread as answered for tracking purposes. If you are still experiencing this error, please comment and let me know so I can continue to attempt to reproduce this error. Thank you.

Hello . I hope you can still help as I am still have mega problems with my BP. I have copied the physics asset from the content examples map. When I press E it should start a check trace to see if it hits actor with tag. The problem I am having is that the BP wont forgot its last action. Its difficult to explain but debugging the graph in real time shows that. Once I have picked up a Pickup tagged actor its sets physics handle as true. When I drop the actor by releasing E it should set physics handle as false right? However once I have dropped the Pickup actor. The graph still thinks physics handle is true and due to the way I have limited my characters abilities via Can Combat Bool slows me down every time I press E key without an object in range. The same happens for the Door that we discussed above. When I go to the door and press E it goes to my Toggle Door function which in turn is just casted to the door BP. However, When I walk away from the door it continues to open and close. Why is my Bool not saying false when actor tag is not hit? Its pretty hard to explain but is there any way you can help me through Skype or something? I have attached a pic of my BP where I think the problem is.

How do you have your physics object set up? Is it possible that, when dropping the physics actor it hits your player character which triggers the pickup event again?

I worked it out. Only took me 4 days lol. My bools coming out of my check trace function would set to true but would not set to false after effected. I have attached a picture below to hopefully help someone out in the future. Thank your for you reply .