Physics or Transition.to

Hi

Can you send a physics object to a fixed location?

As an example I have a static physics body at a fixed location centre of the screen.

I want to throw balls at this object . I know I can use the transition.to but I want to use physics so when the balls collide they will  bounce, gravity etc. The balls will start from a random location so would I approach this somehow with the setLinearVelocity?

Thank you

yeah, you can. Simply use

obj.gravityScale = 0

and by the way it shouldnt be affected by the balls or gravity if its a static body.

Hi thanks, but not what I am after.

If I randomly generate 5 balls (objectA) and want them all to go to a static target, (objectB)

Can I give objectB gravity to pull in objectA

A better way maybe is to use  Transition.to but when objectA is touched from an eventlistener gravity would take over, and the transition would end before the destination is reached.  I did watch a video that suggested this was possible.

Example, balls a flying to the enemy and the user can push them away before they hit the target?

yeah, you can. Simply use

obj.gravityScale = 0

and by the way it shouldnt be affected by the balls or gravity if its a static body.

Hi thanks, but not what I am after.

If I randomly generate 5 balls (objectA) and want them all to go to a static target, (objectB)

Can I give objectB gravity to pull in objectA

A better way maybe is to use  Transition.to but when objectA is touched from an eventlistener gravity would take over, and the transition would end before the destination is reached.  I did watch a video that suggested this was possible.

Example, balls a flying to the enemy and the user can push them away before they hit the target?