Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: doppelmonster on April 15, 2013, 05:01:54 AM

Title: Spherecast option for Raycast
Post by: doppelmonster on April 15, 2013, 05:01:54 AM
Im working on a billard like game and im missing the ability to do a Spherecast.

It would be great if the Raycast action just would get an additonal Radius option to set.

Unfortunateley im not good enough at coding to do it myself....

Thanks,
Matthias
Title: Re: Spherecast option for Raycast
Post by: Lane on April 15, 2013, 08:23:36 AM
Are you just trying to get the size of the object? There are lots of ways to get around not having the spherecast return the radius, you could manually add a variable on those objects for instance, or get scale and manipulate that number.

Title: Re: Spherecast option for Raycast
Post by: doppelmonster on April 15, 2013, 09:54:08 AM
Hi,
I need to check if there is a free way between balls and holes on a pool table. In that way i need a raycast with the thickness of the balls (whenn a ball is only a little bit in the way the raycast will not recognize that, but spherecast will.).

the only solution i can think of with raycast is shooting 3 rays . first from the center, second and third from the outer bounds of the balls. But this will complicate my FSM to much. The other solution might be to create a capsule trigger along the ray of the raycast....

But this is all very clumsy in comparison to a simple spherecast in my opinion.
Title: Re: Spherecast option for Raycast
Post by: Lane on April 15, 2013, 10:02:02 AM
Makes sense. It would definitely be handy then.

Alternatively you could just fire an empty gameobject with a sphere collider on it toward the hole(s) and collect any collision information to bool's for clear/not clear. This would be clunky if you were actively moving the projection angle.
Title: Re: Spherecast option for Raycast
Post by: jeanfabre on April 16, 2013, 01:11:17 AM
Hi,

 is it not actually a sweep test you want to perform? if you look at the doc, sphere cast will ignore colliders set to trigger, I am willing to such action, but I need to make sure you understand this limitation.

http://docs.unity3d.com/Documentation/ScriptReference/Physics.SphereCast.html
http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.SweepTest.html

bye,

 Jean
Title: Re: Spherecast option for Raycast
Post by: doppelmonster on April 16, 2013, 04:33:50 AM
Hi Jean,
i checked the docs. In my situation either would work fine. For simplicity i thought it would be easier to turn a raycast action into a spherecast action.

As i am testing balls, a spherecast would work well. That triggers are ignored is more a feature than a problem for me (in my special situation).

Sweeptest:
The Main advantage i see is that you could use any form of collider (also mesh collider) to sweep.

Would it be possible to use layer masks similar to raycast in a sweeptest?
This is a must have!

cu,
matthias

P.S. i have another request which is going in a similar directon. I need the "Trigger Event" Action to test only one frame and then leave the action, even when there is no collision. In the moment you are stuck in the action until a collision happened. So a "every frame" option would be nice.

 
Title: Re: Spherecast option for Raycast
Post by: jeanfabre on April 17, 2013, 02:21:02 AM
hi,

 can you make your pas as another thread, I'll reply, else it will make threads complicated and difficult to follow.

 I am working right now on the spherecast action, should be available in few minutes.

bye,

 Jean
Title: Re: Spherecast option for Raycast
Post by: doppelmonster on April 17, 2013, 02:34:02 AM
You are great!
Just opened another thread.
Title: Re: Spherecast option for Raycast
Post by: jeanfabre on April 17, 2013, 02:57:44 AM
Hi,

 here we go:

http://hutonggames.com/playmakerforum/index.php?topic=3672.0

bye,

 Jean