CapsuleCast sweeps orthogonal or perspective?

Hi,

I am working on a iphone game and i am trying catch game objects collision using swipes on touch screen. To test it, i am getting samples from swipe points and making CapsuleCast for each line generated by sampler points. The thing i am wondering is that, if it sweeps orthogonal or perspective. Since if it works orthogonal manner then no point to use it as i will be missing some point in my view frustum. Thanks for your time and any idea is more than welcome.

Cheers,

Hi, welcome to the forum!

The capsule cast works like an orthogonal projection (ie, doesn’t get wider with distance) and is mainly useful for checking if a character controller can fit through a gap before moving it. However, I’m not sure that will be a problem with what you are doing here. If you want to create a capsule in the scene that corresponds to a line dragged by a finger then the issue is to get the start and end points of the line with the correct perspective. You can do this using Camera.ScreenToWorldPoint or with a raycast from the camera, as explained here.