How do I make my actor shoot to where I click my mouse
Meanduck
Member Posts: 1
I have a game where my player actor can shoot bullets at other moving actors. When I click my mouse I have it so that the bullet spawns but I want the bullet start to move in the directin of the mouse. This is so that you can change the angle that you shoot the bullet actor. Now i have seen videos on making actors spawn and follow the mouse on the screen but I do not what that. I want this actor to stay in the direction of movement even if move the mouse position. Like a normal bullet after it is fired. Any help would be appreciated. Thanks.
Comments
Hi, what you'll want to do is add two Game Attributes to your game called, MouseX and MouseY. When you click the mouse/or touch the screen record those X and Y coordinates to these two new attributes.
Then use a Move To Behavior on your bullet actor and move to these new coordinates.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thanks I think i found it out.
Do comments really need approved now? I just got that message twice...
Anyway, glad you got it worked out.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
cool
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Glad to hear it
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
cool
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Glad to hear it
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page