Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 10Polarbears on January 18, 2013, 10:13:52 PM

Title: Get Bounding Sphere Action
Post by: 10Polarbears on January 18, 2013, 10:13:52 PM

Can anyone verify if this action has been written properly?

It seems to work but being such a noob I'm not sure.
If someone has a chance to look at it I'd really appreciate it.

Its purpose is to use the renderer.bounds to query the Mesh Renderer then get the local space centre and spherical bounds expressed as a radius from a all components in a gameObject.

Then draw various debug shapes.

Might there be a better way?
Title: Re: Get Bounding Sphere Action
Post by: 10Polarbears on January 18, 2013, 10:49:41 PM

The above script would benefit from an appropriate version of i.e.

      public override string ErrorCheck ()
      {
         return ActionHelpers.CheckOwnerPhysicsSetup (Owner);
      }

Where would I look to find these definitions as a list or where do I go to define such a message.
Title: Re: Get Bounding Sphere Action
Post by: 10Polarbears on January 18, 2013, 11:31:56 PM

Ah ha!

For the error check i now use:
[CheckForComponent(typeof(MeshRenderer))]
Title: Re: Get Bounding Sphere Action
Post by: 10Polarbears on January 20, 2013, 01:40:08 AM
Revised version of the Action which now includes the Mesh Renderer required warning.

It now executes the debug gizmos draw and calculates all values in OnDrawGizmos and calculates the values only OnEnter.