Collision Bug when changing Center/Origin of a Object

I am creating a disintegrate ray in my game.

I want the disintegrate ray to start at the Mage hero and end at a mark, what I am using a raycast to set the mark. So I just make the width of the ray = distance of Mage to the Mark.

The problem is, to achieve the way I want I need to change the origin/center of the object X = 0 and Y = half of the sprite. But when I do that the collision dont follow the witdh size (seems the collision stay the same of the exemple above).

If I left the origin/center in the original way (both half of sprite) the animation become bad (the laser stay in the middle of the Mage) but the collision works perfectly.

So if I am not making anything wrong, I guess the collision box stay the same of the original points (origin/center).

I created a exemple using mouse and not interacting with walls but still can see the bug.

I hope anyone have a idea of how fix this, thanks!

Link of exemple: Dropbox - CollisionBug.zip - Simplify your life

You can cast with Right button (using the origin/center X = 0, but the collision bugs) and Left button (using origin/center = half of sprite, but the position of disintegrate is bad)

a bug.
There are different workarounds for that.
you could make a second invisible laser, put it around the marker and rotate towards player (cover the other half way towards center) or you can use math instead of collision,
or use raycasts to detect whats been hit (also good to use, if you have obstacles like walls) .

Thanks for the reply. Seems be a Gdev bug because collision not comes with the sprite.

The problem of creating a second invisible laser is the collision will bug the same way.

In my game I use raycast because I am creating a twin stick game, to not pass through walls.

I will try check the collisions with the raycast and see what happens, thanks for the idea!

Thanks to your tip to use the reycast to hit I could at least change somethings.

Now I check collision both with ‘walls’ and ‘heroes’, put the mark in the collision position, make the witdh = distance between mage and the mark. But I changed the collision damage to the mark, so I do the damage only to the enemy who is colliding with the mark.

Good thing is working good, the bad thing is the disintegrate ray doesn’t pass through heroes, instead he stops on heroes. But still a amazing skill to use.

Btw, I think I found another weird bug, if I check collision to the object group “Heroes” and mage is included in Heroes, even if I check to the variable team be not equal, the Gdevelop still taking the Mage included, even if the variable Team is not the same.