How do I get an inmovable physic object to rotate properly?

Get help using Construct 2

Post » Tue Apr 15, 2014 9:07 am

I'm trying to get an object to rotate from a point while also being a physic inmovable object (because I want it to interact with other physic objects while rotating). The problem is that when an inmovable physic object rotates (wether by changing the angle, with the rotate behaviour or anything similar) it takes the centre of the sprite as the rotation point, instead of whatever centre point I have defined. Here's a little demonstration of this:

https://dl.dropboxusercontent.com/u/115 ... 0Test.capx

The blue bar is just a sprite with the center on (0,15) and the rotating behaviour. The red bar is the same sprite with a different colour, physics behaviour (with inmovable on so it has infinite mass) and the same rotating behaviour. Is there a way to make the red bar rotate in the same way as the blue one, while keeping the inmovable thing?
B
9
S
4
G
2
Posts: 12
Reputation: 2,772

Post » Tue Apr 15, 2014 11:09 am

Create an invisible rotating sprite, position it to the point you want the red bar to rotate about and then pin the red bar to it.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Wed Apr 16, 2014 3:49 pm

It seems to work. Thanks a lot for the help.
B
9
S
4
G
2
Posts: 12
Reputation: 2,772


Return to How do I....?

Who is online

Users browsing this forum: adventurist and 33 guests