accelerometer rotation

ron.valron.val Member Posts: 16
edited November -1 in Working with GS (Mac)
hey guys I need some help I'm trying to figure out how to make an actor rotate using the accelerometer. what i want to do is as i turn my body i want to have the actor turn with me. so if i turn left the actor turns left if i turn right the actor turns right. but it needs to be smooth from what i have read on the forum so far looking for a solution people have got it to only work like a clock.

Comments

  • youngster9youngster9 Member Posts: 326
    That is not the accelerometer I think that is a gyroscope. GameSalad does not support the gyroscope yet. But it will probably come soon.
  • old_kipperold_kipper Member Posts: 1,420
    constrain 'vector to angle' the accel x, and accel y and if you want it to read the other way add +180 to the end to the equation.

    hope that helps

    kipper
  • ron.valron.val Member Posts: 16
    ok so im new to this whole thing and ive been trying to read all the documentation and i havent found any thing on how to use the rules and all that stuff. this is what i have done so far
    i loaded an image to be my actor i click on the actor i click on the add new rules and i choose attributes. so now i want to set the accelerometer to this actor. so from what i understand (it might be wrong ) I choose devices game.accelerometer.x= vectortoangle(x,y)+180 (so im not sure if im supposed to set the x and y in this equation). so that was for moving right im assuming and for the left im putting game.acceleromter.x=vectorangle(x,y)-180 ( again im not sure if this is right at all this is the first time im setting up a rule and from what i see on my ipad my actor is not moving as i rotate left and right when i put it on the view??????
  • ron.valron.val Member Posts: 16
    thanks for the replies :)
  • old_kipperold_kipper Member Posts: 1,420
    if you want the actor to rotate you then constrain the actor rotation to the vector to angle of the accelerometers (inside the rule if you only want it to act while the rule is true).

    I hope that helps.

    kipper
Sign In or Register to comment.