Possible Bug with custom movement?

0 favourites
  • 3 posts
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • Hi not sure if its a bug or maybe i just misunderstood something, so hope someone can help me.

    I have an event that is triggered by "On created" as part of its actions i have it spawn another object which angle i change to 90. The spawned object have custom movement behaviour on it. So after i have changed it angle to 90, i set angle of motion so it matches the spawned object angle.

    In another event i then tell it to accelerate 50 forward, which makes the object go toward 0 degree instead of 90.

    However if i move the action "Angle of motion = object.angle" to another event and add an acceleration action as well. it moves the correct way.

    I also tried adding "Angle of motion" and set its "angle of motion" to the newly spawned object angle together with an "Accelerate" action in the "On created" event. And it still moves towards 0 and not 90.

    It seems to me that if you use the "spawn another object" and custom movement in the same event there are some problems, or maybe im doing something wrong.

    Anyway im not sure if its a bug or not, can someone confirm it or maybe explain what im doing wrong?

    Heres a link to a test:

    Test custom movement

    Thanks

  • I don't think it's a bug, it's a kind of quirk of the custom movement which is by design.

    Your actions happen in this order:

    1. Set angle of motion

    2. Accelerate

    When the object is created it has zero speed, which also means if you ask for its angle, it has no motion and therefore no angle and just returns 0.

    If you set the angle of motion of an object which is not moving, it effectively does nothing. The object is not moving so has no angle of motion, so there's nothing to change. Then when you do accelerate, since it has no angle of motion it uses 0 and goes to the right.

    If you do it the other way around - accelerate then set the angle of motion - it works, because as soon as you accelerate there is an angle of motion, and that can then be set.

    So, closing as not a bug I'm afraid...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • "So, closing as not a bug I'm afraid... "

    Thats only good :)

    And thanks for the explaination.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)