Bullet

Bullet

Hi,
I have maked a tank that can rotate the cannon but,
How to make the tha the bullet that shots change the direction according to rotation and direction of the cannon
and the bullet shots form 'muzzle'

4 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de havokchrisk

Hey michaelguerra,

Sorry, but I'm not sure I understand your question. When you mention 'muzzle', are you referring to physical kickback on the cannon when a shell is fired, or the particle/lighting effect of a flash and smoke? You should be able to simply get the transform of your cannon and use that as the shell's original shooting direction, and if you want to apply some kickback/recoil, you could apply a force/impulse back against the cannon in the opposite direction as the shell direction.

Chris

Developer Support Engineer
Havok
www.havok.com

Hi,

Sorry for For Write 'muzzle', when i try to refering to the direction when a shell is fired of tip of the cannon

What i have to do ?? ,

Thanks i Waiting for you support

Portrait de havokchrisk

It's up to you on having a convention to specify the cannon's firing direction relative to its physics transform. An easy thing to do would be to setup the cannon rigid body such that, say, the Z axis always pointed in its firing direction... in that case, you could always extract the Z axis and use that as the firing vector.

Chris

Developer Support Engineer
Havok
www.havok.com

Connectez-vous pour laisser un commentaire.