C3 runtime: Calling this._StopTicking(); causes error

0 favourites
  • 7 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • I have a behavior that I need to tick, but obviously I want it to stop ticking when not needed.

    So I call this._StopTicking(). This works fine until I add another instance (or object with the same behavior) into the layout, then I get this.

    Uncaught (in promise) TypeError: Cannot read property 'Tick' of undefined
     at C3.Runtime._BehaviorTick (runtime.js:1)
     at C3.Runtime.Step (runtime.js:1)

    I also have an action where I call it and the action causes no errors. I tried putting it into a trigger condition but that didn´t help. I also checked the "this" and there doesn´t seem to be anything wrong with it. Is it a bug or did I overlook something?

    I´m calling it in instance.js inside the Tick() function.

  • I can't see any reason this would happen. I think I'd need to see running code to investigate.

  • Here´s the plugin and the project I´m testing it with.


    Also while I´m at it, when I´m calling a trigger like you described in the documentation


    It calls it for both behaviors on the sprite (causing that jerky motion), but obviously I want to call it for a single one. How can I do that?


  • What do I do to reproduce the problem? If I install the addon and open wTween.c3p it runs fine with no errors.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The c3p is setup to produce the error. But I think I figured it out... I´m still on the stable release where that error does occur (or should occur when you just start the project) while it appears to be fixed on the latest beta and works fine. I guess you instinctively used the latest version? Could have thought about trying that earlier but it didn´t cross my mind.

    Now I just need to figure out the trigger thing.


  • As per the bug report guidelines you should only test the latest version to avoid reporting issues we've already fixed. Likewise I always test the latest version.

  • My b. But I still don´t get the Trigger thing. I´m calling


    and I have this setup

    But it will Trigger both wTween and wTween2 on complete, but I don´t see why.

    EDIT: I guess I kinda hacked my way around it, it feels hacky but ¯\_(ツ)_/¯

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