Thank You HenryPK,
exactly I do that but I want the spawned object to stop on mouse cross hair I click on screen... the bullet behaviour make spawned object move out the layout can you find a way to do that
great thanks for your help.
Oh, you can make it like this with 3 objects (The Mouse, the Sprite, and a "target" invisible(or not) object):
On "Mouse" Click >>
- Set "Target" position to (Mouse.X, Mouse.Y)
When you click, it will bring the target to the mouse position.
"Target" Is On Screen >>
- "Sprite" set Bullet angle of motion to:" angle (Sprite.x,Sprite.y,Target.x,Target.y)
If there's a target on screen, will move towards it
Else (Target Is not on screen) >>
- "Sprite" set Speed to 0
Won't move if there is no target onscreen
"Sprite" on collison with "Target" >>
- "Target" set position to "-Target.Width,-Target.Height)"
This will make the target go off screen when the Sprite reaches its destination.