body.Awake() has level-protection error

Chipmunk2D Bindings for the Unity3D engine
Post Reply
ensomniac
Posts: 17
Joined: Thu Sep 05, 2013 1:54 pm
Contact:

body.Awake() has level-protection error

Post by ensomniac »

A strange bug I just encountered:

body.Sleep(); // No problems
body.Awake(); // Throws a protection error

Despite calling body.Awake() in the same place as body.Sleep(), the compiler throws this error:
Assets/scripts/controller.js(194,22): BCE0120: 'ChipmunkBody.Awake()' is inaccessible due to its protection level.
To test, I've tried calling storing my body objects in an array outside of core code to ensure the protection level is proper but it doesn't matter. It seems that calling body.Awake() from almost anywhere causes problems. Thanks

Ryan
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: body.Awake() has level-protection error

Post by slembcke »

Awake is a standard Unity event method that is sent to an object when it's first created. You're looking for the Activate() method.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: body.Awake() has level-protection error

Post by slembcke »

/me facepalm

Derp. Thanks for pointing that out.

edit: Fixed now.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests