Not sure if this the right place to be posting, but I need help with a basic weapon in Blueprint. I want to make a simple weapon that does damage to the user if they don't hit another character with it. Is there a way to do this? If so, how?
Announcement
Collapse
No announcement yet.
Need help with Blueprint weapon design
Collapse
X
-
Originally posted by jghall1 View PostNot sure if this the right place to be posting, but I need help with a basic weapon in Blueprint. I want to make a simple weapon that does damage to the user if they don't hit another character with it. Is there a way to do this? If so, how?
-
Originally posted by jghall1 View PostSo how exactly would I go about doing that? Is the FireShot block what I am looking for? And how do I use it to do a hitscan?
The way FireShot & FireShotOverride work is...
FireShot is executed. During FireShot's execution, it checks to see if FireShotOverride() ever returns true. If FireShotOverride does not return true, then FireShot executes built in behavior that fires the weapon.
In your case, you'll want to have FireShotOverride return true, because you desire custom behavior to occur immediately after firing your hitscan trace. So your FireShotOverride method will look something like this (pseudocode):
Code:// this assumes the custom firemode you want to implement is only on the primary fire if (CurrentFireMode == 0) { K2_FireInstantHit(true, HitResult); if (Cast<UTCharacter>(HitResult)) { //any special behavior on hit } else { WeaponOwner.TakeDamage(DamageToTakeOnMiss); } return true; } else { return false; }
Last edited by Wail; 07-08-2015, 08:32 PM.Join Project: Open Tournament: OpenTournamentGame.com | Project Trello | Discord | YouTube
Subscribe to /r/UnrealSeries - The subreddit for free & uncensored discussion of Unreal series games!
Unreal Prime Weapons: Impact Hammer | Enforcer | BioRifle | Shock Rifle | Link Gun | Ripper | Minigun | Flak Cannon | Rocket Launcher | Sniper Rifle | Grenade Launcher | Dispersion Pistol
Comment
-
I'm sorry if I am being dumb, but I am still having trouble understanding. I am working in Blueprint because I am curious to see what I can do with it as opposed to actual coding. I cannot find a FireShotOverride Blueprint node or anything of the sort anywhere. The closest thing is simply FireShot. I don't know how to make FireShotOverride return a specific value, or how to do any kind of if/then statement (in blueprint). I am familiar with the ideas, I just don't know how to execute them in Blueprint.
Comment
-
Comment