Activate Sine Behaviour on sprite touch

0 favourites
  • 5 posts
From the Asset Store
Surena Touch
$2.50 USD
A wrap from official Touch plugin to export touch/mouse input to other plugins.
  • I am making a simple pendulum like to and fro motion, using sine behaviour, where the user first touches the 'Sprite2' object (the one that is colored in red) and then touches the 'Sprite3' object. By touching the 'Sprite3' object, I want the user to active the sine behaviour on the 'Sprite' Object and move to and fro as in the link. How can I do that ?

    Here is the .capx file for the reference.

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • And in another post you wrote that you can't use Sine because you definitely need this to be done with Physics

    I see you disabled the formula in event #3. It's kind of important, it does the circular movement.

  • Yes, I wrote about the physics but now, I want it to have a sine behaviour after clicking on 'Sprite3' object. (not when dragging the 'Sprite')

  • Create a variable "SineIsActive". When Sprite3 is clicked, set it to 1.

    Enable events #2-4.

    Replace condition for event #3, instead of "Is not dragging" put "SineIsActive=1"

    That should be it.

    And don't use "Is touching" for objects that supposed to be touched once! Use "On tap object" or "On touched object".

    "Is touching" is triggered 60 times per second, you don't want this for buttons.

  • dop2000, Many thanks ... you really are the best. Works like a charm. From now on, I'll be using 'On touched object' for buttons instead of 'Is touching'.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)