I need help making a projectile shoot towards my mouse cursor

so basically it will shoot… but only to the right, when i click on the pointer itself

a fix for these 2 problems and it should be good

any help?

1 Like

Welcome to the community @MrPupty .

Firstly, to make the thing shoot anywhere, you have to go the the mouseclick behavior and check the clicks anywhere button.

Screenshot (103)

For your next one, a good example is shown in JR01’s PointAT bundle.
Just replace the variables in the angle to one with mouse x and y
like this:

thank you this is really helpful.

though I have been making games on flowlab for a while I just don’t have the money to upgrade so I just make more accounts lol. I could delete games but I also just forget what log-in I use so until I figure it out I just make a new one

I don’t make too special games anyways but…

1 Like

i do have a separate block for the pointer so my character doesn’t rotate

do i just put it on the pointer instead?

because my problem is it wont turn the whole way

only partly

1 Like

It’s a little hard to understand what you are saying. If you posted a link to your game, other people could help you easily.


if you want to make something aim at the mouse cursor, you will need to combine the X and Y values of the camera AND the mouse position. That will allow the object to account for both layers.

You may also need to offset the player’s X and Y with an expression. This is sometimes needed, but not always.


let me know if you have any questions!


could you send a full image of all the necessary code or a link to look myself?

there are some that is cut off and I’m not sure of what i need and what i don’t and where i need to put it

I’d make it separate.

something weird is happening where when im one one side of an area the cursor cant move left but when im in the middle it works fine

but when im on the right side it cant shoot right now.

any ideas on whats causing this and how to fix it?

maybe someone could look through the code and find an error?

hey sorry;

for the first image, hook the two cables that don’t come from the 5 to the pointat’s X and Y. (the 5 is other code that isnt important)
you can also replace the cursor X and Y globals with a “cursor” behavior and it should work.

In the second image, I’m just using an example of taking the cursor’s Y and giving it an offset. this is inside a bundle, but it doesnt need to be that way.

okay so theres another feature i would like to add where the camera like centers in the middle between the cursor and character

is there a way to do this and if so can you send a screenshot of the code id need for that aswell as a full image of the attack code since i had a hard time understanding what you mean, sorry.

hey! I went back and tried to implement the pointing system myself - here’s what I did.

1. extract the camera’s X and Y into two globals inside the player


2. inside the pointer, combined the camera’s X and Y with the mouse’s X and Y

The pointer followed the mouse perfectly!

I need to get back to my flowjam project now, so see ya! hope this helps :slight_smile:

1 Like

thank you so much!!

I looked at your profile and you have some REALLY impressive games on there. Thanks again for helping and good luck!! :slight_smile:

1 Like