Set "Prevent rotation" as a action in Physic beh.

Discussion and feedback on Construct 2

Post » Sun May 27, 2012 10:38 am

Would it be possible to add "Prevent rotation" as action in physics behahvior,
So you can change it in runtime?

One reason for this would be, that I would want a family/object to be able to rotate in one layout (ex normal mode), but disable the rotation in another layout (ex easy mode), and without having to create a second family/object.CodeMasterMike2012-05-27 10:39:19
B
38
S
13
G
9
Posts: 151
Reputation: 8,437

Post » Sun May 27, 2012 12:07 pm

You could just set a boolean instance variable, then whenever this is true, set angular velocity to 0.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun May 27, 2012 4:23 pm

@sqiddster

Thanks for the tip, but it doesn't work to 100%. A object can still rotate, even though its not by much.

Disabling the rotation directly in the physics engine would be a much better option, because the physics still calculates the rotation, even if I set the angular velocity to 0 every tick.
B
38
S
13
G
9
Posts: 151
Reputation: 8,437

Post » Sun May 27, 2012 4:54 pm

That is true... However until this feature is implemented I would suspect that is the only thing to do.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue May 29, 2012 8:14 am

Yes, its a good temporary solution.
But I went ahead and I created my own function to handle this. And it works perfectly.

If anyone is interested in this function as well, I added it to my plugin. So go to System Manager plugin, or click on this link. The function is called "Allow physics rotation".

Man, I just love the Construct SDK! So much cool stuff you can do with it! CodeMasterMike2012-05-29 08:14:52
B
38
S
13
G
9
Posts: 151
Reputation: 8,437


Return to Construct 2 General

Who is online

Users browsing this forum: Ashley, Elliott, Televangelist and 14 guests