It’s hard to figure out from the .gif what’s going on. However, I suggest you work out the contact points first, then draw, rather than draw and then work out the points.
And you can get rid of the contact flag. It’s not needed if you change the events like this :
Yeah as MrMen said you just need to let starting point of laser follow player point all the time:
For example:
No condition: Action: Laser starting point.x = Player.PointX(laser)
No condition: Action: Laser starting point.y = Player.PointY(laser)
No, that’s not what I said. I said to calculate the contact points first, then draw the laser, rather than the other way round. I made no mention of the laser following the player.
There is no need for the extra position variables, @ilary27 is already using the user defined points on the cecchino object when drawing the laser :
I followed your advice and canceled “contact” which in fact was not needed but I still have this problem on the movement … when the player is stopped everything works correctly.
as soon as the player moves laserdrawer cannot keep up with him.
thank you boys
I was able to solve the problem … I had inserted everything in a sub event and it was unable to quickly manage a movement of the player.
it was enough to pull out the code used in the photo from the sub event and now the drawing is created in the right place