How do I set the Origin Point dynamically?

0 favourites
  • 3 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Hi!

    I want to build a game with Drag and Drop feature. It matters where i touch the piece, so the physics should do their job at this point.

    For example: take a sheet of paper between 2 fingers, it will rotate around the "holding point". That is the origin point in Construct 2. But therefor i need to set it to the position, where the mouse/finger drags/holds the piece.

    Is there a possibility to do that or is it a good idea for a Construct 2 update?

    Greetings

    Kevin

  • As far as I know this isn't possible without writing/rewriting plugins.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Moving the origin will not help with your problem.

    Mixing standard behaviors with physics is almost always wrong, and a bad path to follow.

    The physics behavior attempts to simulate real-world physical interaction with it's environment, whereas the other behaviors do not. This means that when you move a physics object with, for instance, drag and drop, the physics object can end up 'teleporting' in order to update itself. This can cause seriously undesirable effects.

    Physics-based objects should really be moved and controlled using the built-in physics commands.

    From the manual:

    "Using Physics in Construct 2

    The Physics behavior simulates physics separately to the Construct 2 layout. Construct 2 will try to keep the Physics and Construct 2 "worlds" synchronised if one changes but not the other, but this can be unpredictable. For example, setting an object's position or angle will cause Construct 2 to teleport the corresponding object in the physics simulation to the object's new position, which does not always properly take in to account collisions. The same is true of using other Construct 2 behaviors at the same time as Physics.

    Therefore it is highly recommended to control Physics objects entirely via the Physics behavior (by setting forces, impulses, torques etc.), rather than trying to manipulate objects by Set position, Set angle etc.

    Another consequence is Physics won't respond to objects with the Solid or Jumpthru behaviors. These behaviors are totally redundant when using Physics and have no effect. Instead, use the Immovable property."

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