Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: serenefox on February 17, 2017, 04:09:30 AM

Title: Spherecast action not returning hit
Post by: serenefox on February 17, 2017, 04:09:30 AM
Edit:

So I figured out that the spherecast was not working because it started from inside my player(ball) and apparently that does not work since it is starting inside of a collider even if the layermask says not to look at it.

That leaves me with another problem. I figured I could spherecast from above my player in world space to fix it but the action is either from the gameobject or from a position. Is there anyway to make the position a world space offset from my player? (since my player is always rotating)


Original Post:

Hi,

I am using the spherecast action from the ecosystem, but I can't get it to work for some reason. I am trying to cast down from my player(ball) to the ground to check and see if the player is grounded before I jump.

Normally I would use a raycast but if the player is on a slope the raycast sometimes misses even though the player is grounded.

I have it "Return" the the preious state if it doesn't hit anything else send a jump event to continue on. Yet it rarely ever returns a hit. I have attached my settings on the action.

I am thinking maybe I'm not using it right but from the documentation on unity I believe I am.

Any info on how to use it?

Thanks.
Title: Re: Spherecast action not returning hit
Post by: jeanfabre on April 13, 2017, 03:22:13 AM
Hi,

 Just add a child to your player and put it where you want to raycast from and use that child as the gameobject for the action.

 Bye,

 Jean