Blockland Forums > Modification Help
Melee knockback?
Spartan224:
I'm editing a weapon and consider myself a novice coder. I've been looking at other tools or weapons such as the Push Broom to implement some sort of knockback for my weapon using:
impactImpulse
verticalImpulse
But after I implement the two lines starting at line 95, the vertical impulse works, but there's no horizontal impulse which is what I assumed the impactImpulse was? If you'd like to take a look at my weapon I edited, here's a download for the edited weapon. Or you can take a look at the .cs file instead.
https://drive.google.com/open?id=1ySILH-jxmucQE3Oaadm3y8KFvBmZ_cP-
jes00:
After extensive testing I've discovered that the problem is that there is a variable missing in CrowbarProjectile::onCollision. So just add a variable to that and the parent and it'll work. Apparently a lot of add-ons have the wrong number of variables for ::onCollision.
I've had this same problem before making some of my add-ons and I resorted to making my own pushback method. I never figured out why the default one wouldn't work until now.
Spartan224:
Sorry, I'm pretty new to coding. What should I add to that section?
PhantOS:
Look up the server functions megadump on the forums (server commands.txt) and find projectile::oncollision and read what the fields are
Spartan224:
Okay, I'll take a look.
Navigation
[0] Message Index
[#] Next page
Go to full version