Author Topic: Bullet Stucks on Player/Map?  (Read 1135 times)

How or what should i change in the .cs that my Bullet can Stuck on Players or the Map? (like for 10seconds) i finaly made it that it dont make dmg when it hit someone but now i need to now how i can make them stuck >.<

It was painful to try and understand this post, but are you saying you want bullets to stick to stuff?

Hey, I need help with that too. How do you make projectiles stick to other players?

Code: [Select]
   armingDelay         = 9999;
   lifetime            = 9999;
   fadeDelay           = 9999;
   bounceElasticity    = 0.0;
   bounceFriction      = 0.0;
   isBallistic         = true;
   gravityMod = 1.0;
   explodeOnDeath = false;

put that in the projectile data of the weapon. (to change how long the bullet stays, change lifetime and armingDelay)

Thanks VH, you will get credit if I use it.

Oh and you might wanna change gravityMod to 0 if you don't want a spear gun. XD

Thanks, I definitely don't want a spear gun.

Do the bullets stay stuck against players with that? I tried something similar a while back and the bullets would stop in mid air and stay there until their lifetime ran out, but they would not follow the player/vehicle it struck.

You can't have a bullet accurately lodge itself into a player or terrain. Vertical's method will have it drop to the ground and stay there - and it will continue to emit trail particles until it dies which may look somewhat stupid.

The general way to make a projectile stick to the ground is by creating a staticshape with the same shapefile as the projectile wherever it hits, however the staticshape cannot be orientated to the direction the bullet came from.

Furthermore, bullets sticking to players is absolutely not possible since you cannot mount a staticshape to an object with offset (without the mount offset resource on garagegames) and even then, you have to mount it to a particular node which will not guarantee that the mounted object moves with the player's mesh it is supposed to be stuck into. For example if you shoot a person in the leg and the default mount node for the fake projectile is the torso, when the legs move it wont move the fake projectile.

And that is why sticking bullets into players is not a desireable route to be trying to take.

The projectile onCollision function contains the normal of the surface it hit. Would this allow you to orient the static to the surface? (i.e. Portal Gun leaving a Portal directly on the surface)

If not, for a non-ballistic projectile, would using the initial velocity of the projectile let you do something similar? (Sticking at the angle it strikes at, not parallel to the surface)

Yeah, you should be able to orient a static shape on a non-moving surface just fine.