How do I make a function's parameter the object for an...

  • How do I make a function's parameter the object for an instanced variable?

    So basically what I'm trying to do is "(Function.Param(0)).FlipDown"

    (FlipDown being the instanced variable in the object named by "Function.Param(0)" )

    Is it even possible to name an object using the Function.Param(0)? Can I do it through global variables? Thanks, if you need more details, ask.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think the way to do this is to pass the uid of the object as a parameter, then pick the object back, so you can use the instance variables.

  • I think the way to do this is to pass the uid of the object as a parameter, then pick the object back, so you can use the instance variables.

    How would I go about doing this?

  • Function:Call "myfunc" (Sprite.UID)

    ------------- <>8 ----------

    Function: On "myfunc"

    Sprite: Pick instance with UID (Function.param(0)) -->> do something with Sprite.FlipDown

    This technique is limited (but necessary) because you need to know the object type to pick it. You can get somewhat generic by using a Family (C2 full version).

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