swing and accelerometer

fenix66fenix66 Member Posts: 59
edited November -1 in Working with GS (Mac)
I have an actor hanging on the line and I want him to swing with accelerometer.
Any clues how to do it?

Comments

  • fenix66fenix66 Member Posts: 59
    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?
  • old_kipperold_kipper Member Posts: 1,420
    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.

    hope that helps

    kipper
  • fenix66fenix66 Member Posts: 59
    Thanks old_kipper it was very easy and it works great but can you tell me something more specific about the additional motion?
  • old_kipperold_kipper Member Posts: 1,420
    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.

    kipper
Sign In or Register to comment.