Elliptic Raycast

Hi Guys,

I want to do something similar to a Physics.SphereCast, but using an ellipse, not a circle. I’ve done some digging and found a few potential answers, but I was hoping someone had done this before and knows the best port of call:

  1. ‘Dynamic Raycast System’ on the Asset Store, which seems possible, but it’s $30 for a one time needed function.

  2. http://wiki.unity3d.com/index.php/ProceduralPrimitives this is a possible, as that creates a primitive sphere. I could possibly modify it’s shape, to create the desired ellipse, and simply move that across the path, and check for collision. However, this is a fair amount of maths… :S

Does anyone have any other suggestions asides those two?

Thanks!

I can tell you how I would do.

The second option is simpler to do, but I would use a normal sphere without Mesh Render and with a Mesh Collider, and modify the scale to take the form of an ellipse.

Within a loop, make the sphere go from point a to point b and return if it crashed into something or not.

1 Like

Yeah sounds like a good idea to me, thanks :slight_smile:

SweepTest?

1 Like

Didn’t know about that Gem, cheers :slight_smile: