How do I know angle of drag sprite

0 favourites
  • 3 posts
From the Asset Store
Use inertion of your movements to throw, rotate your objects and etc. Objects can interact with others while dragging.g
  • Hello, is it possible to know the angle of a dragged sprite ? I want to associate a particle with a sprite. When the sprite is dragged, I want that the particle is like a "queue" to the sprite, whatever is the sprite angle of motion. Excuse my poor English ! I am not sur to be clear in my explannations...

    Regards,

  • You could compare the oldx and oldy with the currentx and currenty every tick..

    so give the dragged sprite three instance variables OldX, OldY, Dragangle

    DraggedSprite is dragging

    --system compare two values: Draggedsprite.OldX is not Draggedsprite.X

    or

    --system compare two values: Draggedsprite.OldY is not DraggedSprite.Y

    Draggedsprite set Dragangle = angle(Draggedsprite.x,Draggedsprite.y,Draggedsprite.oldX,Draggedsprite.oldy)

    Draggedsprite set oldx = Draggedsprite.x

    Draggedsprite set oldy = Draggedsprite.Y

    Particle set angle = Draggedsprite.DragAngle

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you LittleStain !

    I will try this.

    Have a good day !

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