playMaker

Author Topic: Fire a bullet at player direction  (Read 2108 times)

itokengroup

  • Playmaker Newbie
  • *
  • Posts: 3
Fire a bullet at player direction
« on: February 01, 2017, 08:58:22 PM »
Ok, been stuck for 1 day for this:

I got a 3D character moving around using mouse click (nav mesh).

I want him to fire a bullet (prefab), and that bullet will accelerate on the direction that he is facing. I tried all the stuff in the tutorials and youtube, but cant get it to work.

A noob explanation will help a noob like me.

Thanks in advance!

Ofonna

  • Full Member
  • ***
  • Posts: 230
Re: Fire a bullet at player direction
« Reply #1 on: February 02, 2017, 06:57:57 AM »
hi, you should have an empty object with the z axis at the tip of the gun, ensure the object is a child of the gun aswell and then when you aim at the enemy, use the "look at" action for that empty game object to your target.

this way you would have the z axis pointing at the target, ensuring you get a perfect shot!