Prevent Usable use through wall?
Prevent Usable use through wall?
Hello,
Pretty much the title! I'm able to start a conversation through a wall. Is there some way to prevent this?
Pretty much the title! I'm able to start a conversation through a wall. Is there some way to prevent this?
Re: Prevent Usable use through wall?
Hi,
Add walls to your Selector's Layer Mask so it can detect them.
Add walls to your Selector's Layer Mask so it can detect them.
Re: Prevent Usable use through wall?
I tried that but it still doesn't seem to be working.
Re: Prevent Usable use through wall?
Make sure Raycast All is not turned on, since this will go through GameObjects.
Tick your Selector's Debug checkbox. This will show a debugging gizmo. Here's a screenshot of the gizmo where the Selector's raycast is not blocked:
You can see that the yellow raycast line ends in a green sphere where it detects the Usable (Private Hart).
And here's a screenshot where it's blocked:
You can see that the red sphere indicates where it's blocked.
You can test the same thing yourself. If you need a copy of the scene, let me know, but I just added a cube with dimensions (2,2,0.5) to DemoScene1.
Tick your Selector's Debug checkbox. This will show a debugging gizmo. Here's a screenshot of the gizmo where the Selector's raycast is not blocked:
You can see that the yellow raycast line ends in a green sphere where it detects the Usable (Private Hart).
And here's a screenshot where it's blocked:
You can see that the red sphere indicates where it's blocked.
You can test the same thing yourself. If you need a copy of the scene, let me know, but I just added a cube with dimensions (2,2,0.5) to DemoScene1.
Re: Prevent Usable use through wall?
Yeah, I'm not sure what's going on, it still doesn't seem to be working, even the debug isn't showing up for me.
Here is my selector settings. Is there a setting elsewhere that may be affecting this?
Here is my selector settings. Is there a setting elsewhere that may be affecting this?
Re: Prevent Usable use through wall?
Hi,
I didn't realize you were in 2D. The Debug checkbox works in 3D.
Does your 2D wall have a collider?
I didn't realize you were in 2D. The Debug checkbox works in 3D.
Does your 2D wall have a collider?
Re: Prevent Usable use through wall?
Yeah, I probably should have mentioned I was in 2D, my apologies.
It does yeah, it's a tilemap with a tilemap/composite collider on it.
It does yeah, it's a tilemap with a tilemap/composite collider on it.
Re: Prevent Usable use through wall?
Can you post a screenshot of the wall? Or send a reproduction project to tony (at) pixelcrushers.com? Is the Usable behind the wall? If so, is it really behind it in a raycast (Z axis) sense, or is it just being drawn like it's behind it because of the sprite sort order?
Re: Prevent Usable use through wall?
Here is the wall
Perhaps I actually misunderstood. Is the raycast done from the player's position to the mouse point (assuming you have mouse point selected) or is it from the camera directly to the mouse point. After seeing the option to set the point of where the distance is measured, I unintentionally made the assumption that the raycast is from player position to the mouse position.
Well, it's more like the other side of a wall, or more accurately, through a collider.Perhaps I actually misunderstood. Is the raycast done from the player's position to the mouse point (assuming you have mouse point selected) or is it from the camera directly to the mouse point. After seeing the option to set the point of where the distance is measured, I unintentionally made the assumption that the raycast is from player position to the mouse position.
Re: Prevent Usable use through wall?
Hi,
It's done from the camera. So it sounds like you've identified the issue. The Selector component isn't mandatory. You can use whatever technique of your own to trigger Dialogue System Triggers.
It's done from the camera. So it sounds like you've identified the issue. The Selector component isn't mandatory. You can use whatever technique of your own to trigger Dialogue System Triggers.