How can I make my actor's speed move according to the degree of tilt?

Dell7730Dell7730 Member, PRO Posts: 388
edited March 2015 in Community Tutorials

I have actor in the middle of the screen that moves left or right depending on the direction of tilt, that I don't have a problem with, I need to know how I can set the speed of movement from slow move by small tilt to fast move by big tilt.

Best Answer

Answers

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    Make the speed = direction of tilt.

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:
    Make the speed = direction of tilt.

    Can you give me a sample recipe of the rule? lol

  • SocksSocks London, UK.Member Posts: 12,822

    How are you currently moving the actor left and right ?

  • Dell7730Dell7730 Member, PRO Posts: 388
    edited March 2015

    @Socks said:
    How are you currently moving the actor left and right ?

    to move left:
    if Accelerator is < -0.002 then (-1 * Accelerometer.X) * 3000

    to move right
    if Accelerator is > 0.002 then Accelerometer.X * 3000

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @dellagarpo said:
    if Accelerator is < -0.002 then (-1 * Accelerometer.X) * 3000

    Not sure what that means, what does 'then' mean in this context, is it a change attribute behaviour ? Obviously 'Accelerator' means Accelerometer, but are you able to say which Accelerometer value you are checking (X,Y or Z) ? Can you post a screenshot of your rules ?

  • Dell7730Dell7730 Member, PRO Posts: 388

    @tatiang said:
    Asterisks are special characters for formatting in Vanilla Forums. Make sure to leave spaces around them when posting. I've cleaned up your post for you.

    Thanks

  • Dell7730Dell7730 Member, PRO Posts: 388

    @Socks said:

    Sorry for the very late reply, got taken away to a long drive

Sign In or Register to comment.