How do I make my actor shoot to where I click my mouse

MeanduckMeanduck 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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    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.

  • MeanduckMeanduck Member Posts: 1

    Thanks I think i found it out.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited April 2014

    Do comments really need approved now? I just got that message twice...

    Anyway, glad you got it worked out.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    cool :)

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Glad to hear it

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    cool :)

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Glad to hear it

Sign In or Register to comment.