Throwing objects going in wrong direction

Hello!

I'm creating a little game for myself and I need some help.
In the app, people need to throw an object to specific places by touching the actor and throwing it
in the right direction. I managed to get the actor moving bij touching it, but when I release the actor
it is somehow always going right even if I throw the actor left.

Can anyone help me create a rule which can hold an actor while someone touches it?

This link will show you what I am trying to create (except the areas, only the trowing ball) I can't see the rules and don't know how to make it :-(

THANKS IN ADVANTAGE!

Comments

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

    Rule: When mouse button is down

    -- Constrain self.linear velocity X to 30 *( game.Mouse.Position.X - self.Position.X )

    -- Constrain self.linear velocity Y to 30 *( game.Mouse.Position.Y - self.Position.Y )

    -- Constrain self.Rotation to vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )

  • Jeffrey97_0000Jeffrey97_0000 Member Posts: 13

    Thanks! Much appreciated!

Sign In or Register to comment.