How do I set the Origin Point dynamically?

Get help using Construct 2

Post » Fri Mar 14, 2014 9:19 am

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
B
2
Posts: 3
Reputation: 156

Post » Fri Mar 14, 2014 9:51 am

As far as I know this isn't possible without writing/rewriting plugins.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Fri Mar 14, 2014 10:01 am

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."
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
87
Posts: 5,498
Reputation: 60,282


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 13 guests