TPS Laser Weapons Dont Work As Expected

So, my tilemaps and perhaps more importantly the tile masks are properly set. I have configured movement of the player through arrow keys. The space key is allocated to firing towards where the cursor is located. But the laser appears from the back of the player and not the gun! All help will be appreciated!!!

Hi, could you just post the events for your laser?

Here it is:

This could be a problem with your points. You create the bullet at Gun.X() and Gun.Y(), the origin point of your sprite, which is by default in the upper left corner. You can add a point on your gun for creating the bullet.

If you did not change the origin point of your bullet, it will appear off center. To avoid that you have to move it to the middle of your sprite.

will definitely try it out

I placed all points in the center of the gun and the issue still persists!

Can you show the points of your gun and laser sprite?

Here it is:

I tried specifying the custom “Point” in the gun as Gun.X(“Point”) after creating one and using it in the create object action, but that doesnt work.

The syntax is Gun.PointX(“Point”) - so it’s objectName.PointX("pointName")

That doesnt work either!

I tried the bullet extension and while it plays the sound, it does not play the laser animation. Should i try to assign a valriable to the laser blasts to see if the mechanics are working?

Look at the event that I have that works:

The angle towards where you shoot the bullet can also be the angle of your gun.

If you have an animation of your gun, you need to make sure your custom point is at the correct position for every frame.

Let me try that! Thanks a lot!!!

The idea is to shoot laser guns towards a crosshair mouse and I will try setting all the gun points so the animations plays as desired.

Yes, you also need to consider the origin point of your bullet. So in my case, look at the screenshot below:

The origin point is at the beginning of the bullet, this way it will be positioned exactly on your custom point from your gun.

I have one confusion, if you can please explain it to me, does the points need to be in the gun sprite or the bullet sprite?

Sorry, I guess it was a pretty stupid question! But i am lacking clarity on the issue!!!

You need to specify the points on both sprites.

1 - Gun sprite: Best way is to create a custom point in your gun sprite, at the position where you want the bullet to appear. Do this for every frame of the gun animation (if you have any).
2 - Bullet sprite: Move the origin point to the position where your bullet “starts”. This is important when you have a bullet image with transparent background. Also do this for every frame of the animation (if you have an animation)

Thanks a lot friend, I’ll try it out and see if it works for me!

It still doesnt work! Should I share a screenshot of my eventsheet? will that help?