Object.Angle() in "OnCreated" of a Behavior doesn't work

So I’ve made a simple Behavior that use Object.Angle() in his formulas and I’ve seen something that seems a Bug to me.

I’ve made this simple project that read the Angle of a Sprite with Object.Angle() from the Event of a Scene and another one from the “OnCreated” of a Behavior and this is the result:

Before pressing a Key

After a Key is Pressed

The angle from the Behavior is always 0 and return to normal only using Object.Angle() from the other Behavior Functions (“DoStepPreEvent”, etc.).

I have made this post cause I dont know if it is intended or not or even if it’s already known.
If It’s a Bug just tell me and I will upload the project.

That’s a “semi-bug”. This is not the best behavior and should probably be changed, but it is normal that it does not work since when behaviors were added to GDevelop, their initialization code was put at the very beginning of the object initialization, before setting the objects internal properties (position, angle, etc). Since the object is more or less in an invalid state at that point though I had submitted a while ago a request to change this.

1 Like