We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

constant movement with buttons on mobile devices

Home Forums General Questions constant movement with buttons on mobile devices

  • This topic has 2 replies, 2 voices, and was last updated 2 years ago by post.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #56827
    post
    Customer

    Hi together,

    I am building an app with first person controls.
    For mobile I followed the advice in the faq:
    https://www.soft8soft.com/docs/manual/en/introduction/FAQ.html#first_person_mobile

    I build two html buttons with pointerdown events that move the camera 1 unit forward or backward on click.

    But what I want is a constant movement if I hold the button pressed down on mobile devices.

    How can I get this managed?

    Thanks a lot.
    Best regards,
    Stefan

    #57281

    Hi Stefan,

    To implement continuous movement, you can use variables.
    When the button is pressed, you set a variable for it, e.g. to true. Once the button is released, you set it back to initial value, e.g. false.

    So further in your puzzles you can check every frame if the corresponding variable is set to true.
    If it is, you change the camera position as in that example – otherwise don’t move it.

    Hope this helps.

    Chief 3D Verger | LinkedIn | Twitter

    #57287
    post
    Customer

    Thanks a lot!
    I have to get used to this puzzles.
    Works like a charm :)
    Best regrads,
    Stefan

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.