STEM
Exercise (of ):
- Comment
- Love
Weapon Essentials in UE4 C++ | Pt 2
11 CQ
Your base weapon functionality in Unreal Engine 4 is almost complete! In this lesson, learn how to program the character to fire the weapon using C++.
- Recommended Recommended
- History & In Progress History
- Browse Library
- Most Popular Library
Get Personalized Recommendations
Let us help you figure out what to learn! By taking a short interview you’ll be able to specify your learning interests and goals, so we can recommend the perfect courses and lessons to try next.
Start InterviewYou don't have any lessons in your history.
Just find something that looks interesting and start learning!
5
Comments
Max K
Hey Chad, Nice work man, but I got a question regarding your WeaponSpread. You mentioned, that the spread is basically for shotguns or recoil of a weapon. You give the Firing function a random right from the start. For the shotgun that's a pretty clever solution, however when using a single Bullet and adding a spread for recoil it doesn't make any sense. Why would my weapon be random from the start and not rather after shooting a few times. I want my weapon to be straight at the beginning....
appreciate
appreciated
–
reply
–
delete
Chad Reddick
Max K, Set your WeaponSpread to 0 and it should keep the spread from spreading.
appreciate
appreciated
–
reply
–
delete
Max K
....and then start spreading, so the user does have some control over the recoil and the shots aren't random at first. Wouldn't it be better to start the random seed let's say on the 3rd or fourth iteration of the Spreading Loop?
appreciate
appreciated
–
reply
–
delete
Chad Reddick
It's possible to set the amount of spread you wish. the parameter for the weapon spread amount is how far do you want the bullet to be a random direction from the radius. The lower number the more accurate the bullet is every shot.
appreciate
appreciated
–
reply
–
delete
Allen G
I'll come back and send you some donations for these tutorials. Easily the best ones for C++ available right now. Thanks!
appreciate
appreciated
–
reply
–
delete