1
Suggestions & Requests / Re: guns that are actualey accureate
« on: June 09, 2018, 02:01:37 PM »Muzzle can jerk to the side but not up.Like Rally said...
All weapons I've used set the projectile to a random trajectory when it spawns from the weapon's muzzle point. The correct way would be to keep the projectile trajectory in line with where the muzzle is aiming (or where the eye is aiming depending on user preference) and rotate the player object each time the weapon is fired. This allows the player to have some control over the recoil.
Unfortunately, in my experience, you cannot modify the player's pitch server-side. You can only modify the player's yaw using setTransform so the best you could do is have recoil left or right, without any recoil up or down. The only two options that I am aware of is a revision to the game allowing pitch to be modified or the addition of client-sided commands to control the player's pitch. Client-sided commands won't work on multiplayer because it would be extremely easy to block those commands and remove weapon recoil for yourself.
Code: [Select]
package FakeRecoil {
function mouseFire(%bool) {
Parent::mouseFire(%bool);
pitch(getRandom(-8, -4));
yaw(getRandom(-6, 6));
}
};
activatePackage(FakeRecoil);