Trying to get player (actor) to rotate & gravity with phone!

rbnarcosrbnarcos Member Posts: 11
edited November -1 in Working with GS (Mac)
Okay so I'm trying to get a player in a game to rotate and fall/gravity down in the scene when I rotate my phone. I need everything else in the scene to stay where it is and just my player to fall. He's a picture example of what I'm trying to accomplish.
Image and video hosting by TinyPic
and of course to rotate both clockwise and counter clock wise.

Comments

  • old_kipperold_kipper Member Posts: 1,420
    Not the easiest of goals. Use accelerometer instead of gravity and you will have to set up counter rotate math for the correction of the gravity as you rotate the actor as it will change if you just rotate the actor toward the rotating source.

    Start by watching T-shirtbooth's accelerometer video and turning off gravity. I'm using vector to angle to rotate the actor, and counter that with an inverse rule on the pull of the accelerometer for the direction of the pull on the actor. The collision boxes on your actor will be a problem in the corners but if you are careful with the animation and fiddle a lot with it you can get some very nice results. There are some very nice tricks you can do with a sets of different "lean" in the animation as well and this can avoid problems with collision boxes by invoking different 'lean sets' of animation while keeping a restricted set of rotations of the actor.

    I am trying a route where you can try to create a generic actor object with all the rules and and an environment that sends to game attribute you set up, so the to work together and you can use the actor object multiple times. This is what I am working on. Play with each set of rules as you go and find what works best for you. Real nice things can happen and I've not really seen it done much.

    There is one Japanese guy who has done a lot of work on this kind of stuff (not in GS) but I can find a ref to him at the moment (message me if you like and I will see what I can do)....

    Good luck! Kipper
Sign In or Register to comment.