Javascript で Behavior properties にアクセスする方法はありますか?

式(expression)には

Object.Behavior::PropertyAAA()

と入力すればプロパティを得ることができますが、これを javascript で記述する方法がわかりません。

Javascript で Behavior properties にアクセスする方法を教えて下さい。

====

The expression is

Object.Behavior :: PropertyAAA ()

I can get the property by typing, but I don’t know how to write it in javascript.

How do I access Behavior properties with Javascript?

Right now a property called “AAA” have methods generated as _getAAA and _setAAA.
As the underscore implies though, it’s considered private so be sure to be ready to update this if this change for some reasons in the future - it’s not part of the public API so if it’s renamed in a future version of GDevelop, you’ll have to adapt your game :slight_smile:

1 Like

Thank you @4ian :smile:

As you told me, I was able to access it this way.

let AAA = objects[0].getBehavior("Behavior")._getAAA();
AAA++;
objects[0].getBehavior("Behavior")._setAAA(AAA);

For the time being, I will use this methods.

1 Like