Yes, I saw that, but I need something a little different and not so complex. Just an actor hanging from the line and swinging when accelerometer attributes changes. Any help here?
easy way is to have the art for the actor and the rope in a single file with the top point of the rope as the centre point of the image. Then you constrain the rotation of the actor to the vector of the x and y accelerometers. This will keep the actor hanging vertically. If you want more than that you can add a self attribute real number which is added to the vector to angle, and put another factor into the self integer attribute that gives the swinging additional motion.
to achieve swing and inertia you need to add some kind of addition value from movement and the rotation of the device. This has to decline based on settling, or increase on movement. It is something I have been working on myself and its not that easy. You have to have a pool of values that you can increase and decrease then feed the sum on top of the vector to angle.
Comments
Just an actor hanging from the line and swinging when accelerometer attributes changes.
Any help here?
hope that helps
kipper
kipper