Enable/Disable Behaviour

This forum is currently in read-only mode.
  • Is it possible to enable or disable a behaviour (such as platform movement) using an action (or perhaps script)?

    I would like to have two movement behaviours on an object, but switch between the two at runtime.

  • Yeah, most of the behaviors have a "Set activated" action which enables/disables the behavior.

  • Ah yeah, found it. Thanks!

  • using 'Set Activated' is an option but using 'Ignore Input' is better because in many cases you want the sprite to get affected by the properties of the behavior like gravity etc. but don't want it to respond to user's input.

    An example would be that suppose if you want to switch controls between 2 sprites with Platform behavior. If your one of the sprites is in mid air(jumping) and you disable it's platform behavior, it will hang in the mid air and the control will go to the other sprite.

    Here is an example of ignore input.

    http://dl.dropbox.com/u/5811650/Help%20 ... ntrols.cap

  • using 'Set Activated' is an option but using 'Ignore Input' is better because in many cases you want the sprite to get affected by the properties of the behavior like gravity etc. but don't want it to respond to user's input.

    An example would be that suppose if you want to switch controls between 2 sprites with Platform behavior. If your one of the sprites is in mid air(jumping) and you disable it's platform behavior, it will hang in the mid air and the control will go to the other sprite.

    Here is an example of ignore input.

    http://dl.dropbox.com/u/5811650/Help%20 ... ntrols.cap

    While that is good for your example, its not very good if you have 2 movement behaviors on the same object as the OP said. If you have platform movement and physics behavior on the same object for example, and have both activated you will get weird results.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • While that is good for your example, its not very good if you have 2 movement behaviors on the same object as the OP said. If you have platform movement and physics behavior on the same object for example, and have both activated you will get weird results.

    I should read things more carefully

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