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
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 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.
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.
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 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.
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?
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 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
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
Comments
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
screenshot : http://raganasligzda.lv/citi/accelometer.png
In game atributes are : real object - GravityDirection