1.
The essential difference between ucweapon and ucweaponranged weapons is that the latter requires bullets, which means that the latter will need to check the player's ammunition if they can baseaction.
The knife is to detect whether to play the animation can know whether they should attack, but the gun is not, because the gun before the attack is to put the bullets out, so uweaponrange baseaction notice Ucweapon privatebaseaction event, Specific weapons rewrite this event specifically to Ucweaponchargun is this
Privatebasetion incident Chargun First brush out projectil, then brush out Ucshell, and then no matter, after all, gun baseaction is issued bullets, bullets can hurt blame, not gun
Analysis of 2 casings
The implementation of the bullet was divided into shells (Ucshell) and Bullets (Ucprojectil),
Ucshell model
The main role of the cartridge is to mimic the bounce of the cartridge, which bounces up to 6 times and disappears.
This large piece of code is for the shell to set the rotation and speed, a thing to move and rotate up, UC is to add
3 Bullet Analysis
The core of the bullet is the hit event, and the overall logic is that if the bullet does not hit the bot, it simulates a physical effect on the struck object and creates a bullet hole that, if struck, is handled by the bot's hit event, and the bullet is ignored.
Then back to Chargun, the process of brushing bullets, the first is at the muzzle of a fire particle effect, simulation of the real gun
Then brush bullets, and forbid bullets to injure themselves,
Finally, the trajectory is drawn out, the effect is in the movement can be seen
Finally talk about shotgun bullets, shotgun bullets is a bullet contains more than a bullet, just need to in a for loop more than a few rounds of bullets,
-----------Reprint please indicate the source
The guns and bullets of the UC weapon system