How to make specific gravity

JaxterJaxter Member, PRO Posts: 398
edited November -1 in Working with GS (Mac)
Heel on my ipad i want to cret ball from top, and fall down ( i did it with gravity, but how can make it fall to any direction turning my ipad.. example..

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Well instead of gravity you should use an accelerate behavior. And then you can change the accelerate direction based on the device orientation.
  • JaxterJaxter Member, PRO Posts: 398
    So if the orientation is portrait and is nearly vertical there would be heavy gravity going to the bottom of the screen. If the device is at a 45 degree angle, the gravity is pointing at that lowest corner. Also if the device is laying flat on a table there is no real gravity going any direction.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    ah well you maybe getting into a little more than GS can handle with the device laying flat part but you should be able to use the accelerometer to set the angle the the ball is accelerating toward based on the devices rotation. I don't have any real experience messing with the accelerometer so i'm not exactly sure what the rule is I just know you should be able to make the accelerate direction change incrementally with the devices rotation.
  • JaxterJaxter Member, PRO Posts: 398
    ok imagine, like sand in glass box.. when you turn ipad any direction sand roles always to devices lowest point.. with accelerometer is hard to do is any way to change gravity depending on angle?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Dont use gravity. Make gravity 0 and create a real game attribute called GravityDirection.

    Then is your actor place an accelerate behavior directly in the actor and for direction open the expression editor and find game.GravityDirection

    Now make the accelerometer adjust game.GravityDirection based on the rotation of the device.

    When holding the device upright you want the direction to be 270 and then make your accelerometer rules adjust it from there.

    ___________________________________________________________________________________
    GS BubbleBall Template HERE!!
    Stacks Level Selection Template HERE!!
    AppSolute Entertainment on Facebook
  • JaxterJaxter Member, PRO Posts: 398
    I did t like you say but nothing happens my actor even not moving

    screenshot : http://raganasligzda.lv/citi/accelometer.png

    In game atributes are : real object - GravityDirection
  • JaxterJaxter Member, PRO Posts: 398
    It just moving down and then just stops..
  • calvin9403calvin9403 Member Posts: 3,186
    you made it reverse
  • JaxterJaxter Member, PRO Posts: 398
    i made reverse.. in direction now is: Game.GravityDirection and in accelerate is 270... rsult again the same.. jus going down and stays in the midle not moving on any side
Sign In or Register to comment.