HELP: Shooting in the direction of my cursor!

I am making a platformer and need help! I want to have my actor shoot a bullet/blast in the direction of my mouse. I also don't want it to follow my mouse though. You can see this mechanic I am trying to "replicate" in the popular game, "No Time to Explain"
I hope someone will be able to help.

Comments

  • It's likely not the best way to do it, but here is how I've got a similar function set up in my game.

    1. Create two attributes (MouseX, MouseY)
    2. Have an actor Constrain these attributes to the Mouse position
    3. Have the desired actor (bullet) run a timer for .1 seconds
    4. In this timer run the behavior "Accelerate towards" and give it the coordinates of the mouse attributes.
    5. Profit.
Sign In or Register to comment.