The guns and bullets of the UC weapon system

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.