Third Person Template
I have a feature where, if you press a button, the camera moves to the side. I’m moving the followcamera’s Y axis.
I want to block the feature if there is something to the side of the camera, so that it doesn’t clip into objects.
How can I line trace to the side of the camera (not the character) to detect an object?
You could go with a linetrace function on a loop and just fire off to the side/s. This is an example for firing a linetrace 100 units to the left of where camera is. You can use a boop and if (branch) to enable/disable your camera shift script.
Consider doing it another way. You can have a collision box/sphere around you camera and you can use overlap begin/end events to set your bool that way. I haven’t actually tested this but it might be better idea then having a constantly running linetrace. I tested the line trace and it does work as intended.
Please let me know if this was helpful at all. Thanks.