Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: Kubold on March 24, 2014, 09:30:01 AM

Title: Face cast - like raycast, but casts a square
Post by: Kubold on March 24, 2014, 09:30:01 AM
Hi,

Is it possible to do a Facecast, that would work exactly like Raycast Action, but casted Faces with custom size, instead of rays or spheres?

The only thing: there should be 2 HitPoint variables: One of them should point to actual intersection of the Face and geometry it hit. The other variable should point to the center of the Face in the moment of hit.

Thanks!
Title: Re: Face cast - like raycast, but casts a square
Post by: Lane on March 24, 2014, 09:37:03 AM
I don't see anything in the Unity Scripting Reference for a facecast, otherwise we could just make an action for it. Is it some custom thing you have used before?
Title: Re: Face cast - like raycast, but casts a square
Post by: Kubold on March 24, 2014, 10:22:33 AM
Yes, but not in Uniy. For camera anti-wall clipping. Every frame, I casted a face. If it collided with a wall, the camera was moved on local Z axis to the center of the face.

The point was, that if you did it on raycast, the camera ended up in the wall anyway, if the angle of hit was very small (see picture attached). This is caused by NearClip distance - the larger it is, the bigger the problem.

If Unity doesn't have this, I'll just work aroud it, with 4 raycasts or something. Unless somebody already figured it out and wants to share :)

Thanks!