How do I Raycast From Custom Behavior
I am currently trying to use the Raycast ‘condition’ to check for line of sight with an object. Normally this would be a walk in the park, but I am trying to do it in a custom behavior. As some of you may know, the raycast condition requires scene variables to store the hit position in, but so far I have been unable to find a way to access those variables.
What is the expected result
The object should be able to see the target if it has LOS and is in range. I have tested range and know for sure it works, so that is not the issue. It appears the main problem is the scene variables are not being updated, because their values are still (-1,-1), meaning nothing has been hit. Those values are a hard-coded position off the map.
What is the actual result
As mentioned previously, the scene variables are simply not updating.
Related screenshots
Code:
Behavior parameters:
*Please note that the behavior is ‘Target Selection’, and the icon is a crosshair
Any advice or general help is appreciated!