Question about accuracy in tutorial

Hello I am looking at gdevelop I don’t really know what it can or cannot do.
My snag is on the tank tutorial. Everything was going great and then it came to the part where you edit the point on the cannon tip to shoot the bullets from.
Unfortunately the bullets were not coming right from the point we set in the tutorial. Sometimes they were.
Sometimes they were a little offset.
This was really offputting to me because it just is not fun in a game to see that.
Is there a way to fix this somehow?
I did exactly what the tutorial said and it was working generally except for that darn offset.

The shot is being made at the origin, if you look at the points in the editor the origin is (by default) the top left corner, you can either expression the offset ( -bullet.Width()/2) or hard code it create object → cannon.PointX(Barrel)-16 (or whatever half is). This is just an example, I didn’t look back on the tutorial to see what is what, but I believe that is the problem your having.

You can also change the origin point to the centre…

I did create a new point and set it at the gun barrel end. I understand that part. I then set the spawn of the bullet at the new point on the end of the barrel also. It just came out a little bit to one side.
Thanks anyway.

You need to move origin point of a bullet, so it’s more or less in the middle.

Yes I was forget to mention that you need to set the origin point of the bullet. Fixed it :stuck_out_tongue:

I guess I didn’t explain it good enough…for the easy route yes just change the origin point, which I already stated, but was unclear.

Unfortunately, the page of tutorials is rather dated as updates to remedy this problem you can find many updates inside the wiki.

Then to speed up you can always ask the forum so much is not a problem indeed it is a pleasure.

Now unfortunately it is not yet supported on gdevelop5 but it is likely that in the future the version will be updated and then inserted there too.

is one of the steps that made me crazy more what you ask then however once understood the steps become a little frustrating as a procedure.

You can find a practical example on the tutorials number 12: [url]Video collection for beginners - #4 by LucaTexas] .

You have to move the Origin point and the Centre point as well, both points at the same position, otherwise the bullet will be created centered (Origin) but will rotate around another point (Centre), resulting in a bad effect :wink:

Yes, I set the origin to the center of the bullet and it is now working. Thanks