Capturing mouse location

Hello. was just wondering if there was a way to capture the cursor’s location to aim and shoot.

Yes there’s a mouse behavior that does exactly that, then you can use the point at behavior to point an object at the mouse…

is there a way that i can make it so that the player doesnt rotate but the mouse still aims?

Yes, there is. Have a block, and make it attach to your guy, and make it point to your mouse position, and for shooting, when you click or space, make it emit a bullet. Does this make sense? Do you need a example?

uh. an example would be great.

Ok, I will be a minute.

Ok, I just made this example…

2 Likes

Thanks @GameMaster107

1 Like

Anytime!

thanks. Im just trying to figure out why it is shooting 2 bullets now. Not ur fault. mine, messed some of my own code up lol

1 Like

i figured it out. Somehow, the lines that connect numbers say 1 but when they go into a + in the number, they count as 2 so i just made everything 0.5 and now it works. lol

anyone want to test it and make sure nothing is broken? https://flowlab.io/game/play/1622234