How do I make a person shoot where he is looking?

0 favourites
  • 4 posts
From the Asset Store
A shoot template with ragdoll effect and enemy see you.
  • basically i want me person to shoot where he is looking and not where the mouse is and i can't figure out how to do that anyone out know?

  • You really need to show some starting code

    and a screen shot of your game idea.

    Eg what is your game? side scroll / top down / isometric

    What is your control idea?

    What is your character mechanic. Separate Gun / Body / Head

    etc

    Basically though the angle of your character , or where your character is looking, will be (or can be) defined

    and you just need to use that angle to set the bullet angle of motion when firing

  • it is a top down game with 8 directions i want him to throw torches but i had to make so you throw it where the mouse is on screen but i don't like that so i wanted to know if there was a way to make is so he throws it where he is looking.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • of course there is...you can pretty much do anything you can think of with Construct

    in this case Just set the angle of torch fire based on the 8 direction

    eg

    right = set bullet angle motion 0

    up right = set bullet angle motion 45

    up = set bullet angle motion 90

    etc

    (ps for the down directions use negative angles eg down = -90 deg

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)