Author Topic: Firing from centre VS firing from bone  (Read 1057 times)

Galavant Garde

  • Full Member
  • ***
  • Posts: 119
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Firing from centre VS firing from bone
« on: March 11, 2016, 04:48:58 AM »
Oh hey guys, I'm having a little issue with enemies firing accurately.

I want my enemy fire to spawn particles while flying through the air so you can effectively see the bullets.  Think like the small rings you see on the Matrix when they're shooting in slow motion.  Anyway, the effect looks pretty cool, but the problem is when you set the enemy to look at the player, and set 'look' to affect weapons, it means the angle the object is facing (which is directly at the player) becomes the same angle the projectile is fired from.  This means if you're firing from the centre, it'll hit the player...whereas if you're firing from the enemy's gun (which in my case is held up to the left shoulder) the bullet always flies over the player's shoulder too.  Basically, the bullet travels parallel to the line of sight hence it never hits.  To mitigate it I added a slop to the projectile, but it hardly ever hits and is still too inaccurate.

Is there any way to set the look origin to a bone?  Or to have a static projectile slop so I can aim slightly inward to intersect the line of sight and hit the player more often?  I'm still trying solutions so if I work one out I'll post it.  Open to any suggestions  8)

Galavant Garde

  • Full Member
  • ***
  • Posts: 119
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: Firing from centre VS firing from bone
« Reply #1 on: March 11, 2016, 05:03:13 AM »
Worked it out - using offset angles  ;D

It only really works when fairly close - the further you get away the offset angle loses its accuracy.  But when the player is far away, you can just fire from the centre as you won't really be able to tell if the particles don't line up with the gun perfectly from a distance

ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 196
    • View Profile
    • Klink! Software
Re: Firing from centre VS firing from bone
« Reply #2 on: March 11, 2016, 10:11:04 PM »
Sorry, missed this one, but yup, offset positions and angles are there for this purpose, to allow you to push something around.  As you note, you have to be careful about the angle because once one gets too big, it'll effect the axis that other angles rotate around.

[>] Brian