WHAT I'M TRYING TO DO
The custom Camera System I'm trying to set up is to have the 3D Camera follow behind the Player and rotate around accordingly. The Camera will be set to the end of the Camera Arm (which, itself, will be attached to the Player). The Camera will be set to the Arm's image point at the far end.
As the Arm will do the actual rotating - the Camera being "along for the ride" - to avoid having the Camera on the opposite side of the "3D Walls" (a series of 2D sprites stacked via Z Elevation) and thereby having the view obstructed, I want the width of the Arm to be dynamically reduced to keep the Camera within the boundaries of the Wall. This would mean the Camera is momentarily brought closer to the Player...but as the Player moves away from the Wall, the Arm will grow back to its maximum width and the Camera will likewise be farther from the Player.
I want to use Ray Casting (Line of Sight behavior given to the Arm) to determine if the Arm is overlapping a Wall and automatically adjust the Width of the Arm so that it is not extending past the closest edge of the Wall to the Player. This would keep the Camera inside the immediate surrounding boundaries of the Player.
GREEN TRIANGLE: Player
BLUE ARROW: Player facing direction
GREEN ARROW: Indicates Player rotation
RED BOX: Camera Arm (origin point is at the right-most end, attached to the Player)
ORANGE ARROW: Ray Cast
The Ray Cast is meant to say, "This far to the Wall from the Player...the Arm should not be any longer than this value."
PROBLEM
Besides the fact that this isn't working and thus the need for this post asking for help?
Right now, the Arm is not updating its width.
I added a Global Variable to test if the Ray Cast intersection is returning a True value. ...it is not.
From reading the C3 Manual, It is my understanding that using the action Cast LOS Ray from /origin/ to /target/ will return a True or False and can be used in conjunction with the condition LOS Ray Intersected.
The problem I'm facing is that there doesn't seem to be a True value returned when I cast the Ray. I want to specify which Wall to cast to and yet nothing works. The Global Variable always remains its initial value of 0.
This is the latest configuration of events I've tried (I've had it used as a dual condition with LOS Ray Intersected before moving it up to event line 3):
I would be glad for some insight and help to better understand how Ray Cast works so I can utilize it properly.
THANKS!
EDIT: PROBLEM RESOLVED
I discovered that objects that could potentially register as a "hit" or intersection alone the Ray Cast line must have a Solid behavior. So not just any object in the Layout will trigger a Ray Cast "hit".
This was tested by opening the "Instant hit laser" C3 example (find it through the Start Page tab) where I added a basic sprite. The laser when right through my sprite but not through the Rock sprites included in the example. I noticed a major difference between my sprite and the Rocks - the Solid behavior. I disabled the Solid behavior on the Rocks and the laser when through them, just as it did with my sprite. I further tested this in my project and added the Solid behavior on the sprite I was testing an intersection on...and the thing worked! A "hit" was detected.