Assigning accelerometer values to attributes

Rob2Rob2 Member Posts: 2,402
edited November -1 in Working with GS (Mac)
I can assign arbitrary values to attributes, just as I would variables in code but can't seem to do the same with the values coming back from the accelerometer...any ideas? Is it because they are not integers?

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    what are you trying to accomplish? Grabbing a constant stream of values from the accelerometer or just grabbing them once?

    to assign them once:

    when actor is touched
    change game.CustomAttribute = game.Accelerometer.X
    change game.CustomAttribute = game.Accelerometer.Y
    change game.CustomAttribute = game.Accelerometer.Z

    for a constant stream:

    every .1 seconds
    change game.CustomAttribute = game.Accelerometer.X
    change game.CustomAttribute = game.Accelerometer.Y
    change game.CustomAttribute = game.Accelerometer.Z

    Just make sure you use the expression editor to choose your attributes and the game accelerometer information, if you just type it in it will not work.
  • Rob2Rob2 Member Posts: 2,402
    Excellent, thanks very much for your time.

    I am very much in the exploration stage but certainly want to work out good smoothing of the accelerometer.

    Rob
Sign In or Register to comment.