Weapon fire

I have found that HelloIntersection and ballthrower in physics very useful for handguns sniper rifles and such, but how do you acurately simulate automatic fire e.g ingrams, uzis where accuracy is sacrificed in favour spread, some ideas on shotguns will be appreciated aswell





thanks in advance

Something as simple as introducing a slight random error to the direction element of the aiming ray should work.



Direction.x += ((Math.random() * 2) - 1);

Direction.y += ((Math.random() * 2) - 1);

Direction.z += ((Math.random() * 2) - 1);



for example… and yes, that's probably not the best random generation (simply getting my idea across).

thanks just needed some thing to work with :smiley: