How do loop uid object 10 degrees on left button mouse press

  • Hi,

    How it´s possible every time left button is pressed and rotate X degrees a objet uid (it´s the same sprite that repeat 3/4/5/6 twices?)

    thanks

  • On mouse left click 
    Pick object with UID = <Something>
    --> Set Object.angle = Object.angle + 10
    [/code:9bmlp27h]
  • Ok. i do like that but want repeat for every click. I´m confuse... for create loop

    I try for each or while but i did it wrong always time have a bug. Thanks

  • You should try to explain better what you are trying to do.

    Point is, in the event itself you only reference the girar-object, but in the actions you have the Hbar-object, the IdHbar-object and the UIDToProperties object.

    If any of the objects in the actions have more than one instance on the layout, there is no way for the program to know which one you mean.

  • sorry. I try explain better .

    1) I want the player can rotate a sprite each time is click with left button mouse... a few degrees every time for rotate 360º the object/sprite if he want.

    2)The rotate object is a same simple sprite. Is for that, I must detect the UIDobject for informate the system wich object must be rotate. I detect the UIDobject whith the variable UidBar. This part is working.

    En resume, i want a loop in left mouse button that can rotate each click the sprite/object select for UID.

    Thanks.

    Thanks.

  • Ok so you just want to know how to add 10 degrees every time you click..

    the action should be

    object set angle - angle= object.angle+10

    every time the button is clicked 10 degrees is added to the current angle of the object.

  • I did like you said. But i lost UID unique and the all sprite rotate. if i did with my metod, Detect UID unique but only work one time (see the disable action in image)Hope you can mix the two for loop rotate and detect UID for a same sprite.

  • I think you are overcomplicating things.

    I'm not sure why you'd remove the other actions and not just change the set angle.

    Why are you not picking the right instance inside the event?

  • OK. I see it again de 0. For i can learn how you´ll make for you, can you put a file example how you ll do it with a same sprite (multiplicate this object x4 with create object ) and rotate 360º the object you select it.

  • I'd rather you upload your capx and explain what you are trying to do..

    You have to tell the computer which sprite you want to rotate.

    I don't see anything in your events telling the computer that.

    The biggest issue is how you would like to select the right sprite.

    There are many options for that.

    • clicking on them and setting a variable
    • adding them to a container, so the rotate button is always associated with that sprites
    • other events concerning that sprite
    • pick nearest
    • pick by comparison.

    If you know which sprite should be affected, there must be a way you can let the computer know.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • look the new file. I put it in server.

    The bar can move with left mouse and the blue circle is only for rotate one bar.... but like it´s the same sprite, i can´t reset uid and the button move all together.

    In future, i would have serveral bars and circles, and player can choose one and rotate them like he want. But with a same instance for each... I want detect wich instance (bar/circle) player select and player can rotate the select sprite with a button. I try for that reset the uid for do this action.

    xxxxxx.dimetuplan(dot)com/reboundtest2.capx

    thx

  • it ´s so easy with you! Ok for pick all... thx a lot.

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