+ All Categories
Home > Documents > Read mepdf v3_0_07_01rangeweaponcontrol

Read mepdf v3_0_07_01rangeweaponcontrol

Date post: 06-Aug-2015
Category:
Upload: matumit-sombunjaroen
View: 59 times
Download: 1 times
Share this document with a friend
13
Setup Range Weapon Prefab Last Updated in 3.0 Add Transform named “attackTransform” as a child of Base Transform This will be where the Bullet got Instantiated Weapon will shoot Once per each attackTransform attackTransform
Transcript
Page 1: Read mepdf v3_0_07_01rangeweaponcontrol

Setup Range Weapon Prefab

Last Updated in 3.0

Add Transform named “attackTransform” as a child of Base Transform

This will be where the Bullet got Instantiated Weapon will shoot Once per each attackTransform

attackTransform

Page 2: Read mepdf v3_0_07_01rangeweaponcontrol

WeaponData FireArm

Last Updated in 3.0

Range is specifically use if AuxData_Bullet Type is RayCast It determine how far can the Weapon Shoot VarType determine the MotionSet that the Character will Use. You can check the number in EnumCollection.cs FIREARMTYPE

Page 3: Read mepdf v3_0_07_01rangeweaponcontrol

AuxData_Bullet

Last Updated in 2.3

Bullet is separated into RayCast and GameObject Type and each will be explain individually

Page 4: Read mepdf v3_0_07_01rangeweaponcontrol

AuxData_Bullet RayCast Type

Last Updated in 2.3

For this type, AuxPrefab will be instantiated at the Location where the Raycast Hit

For Example, Spark Effect is Instantiated there to simulate that the Bullet simply fly and Hit there.

This type also use Range Data from FireArm to determine if the RayCastHit Location is within

range or not.

Page 5: Read mepdf v3_0_07_01rangeweaponcontrol

AuxData_Bullet GameObject Type

Last Updated in 3.0

For this type, AuxPrefab will be instantiated at the Location where attackTransform is

Speed and Life Span parameter is use to Instantiate Bullet

Bullet Prefab must have these Components attached Bullet_3DF Collider RigidBody

Page 6: Read mepdf v3_0_07_01rangeweaponcontrol

Fire Rate

Last Updated in 2.3

FireRate determine how fast the Character can Shoot per Cycle Check AuxData_Bullet for further detail Formula for FireRate is in WeaponControl_FireArm, Function CalcFireRate() This will be use in WaitForSeconds() to calculate how much time do the Character have to wait to

be able to fire the next round.

**IMPORTANT** Value of 0 will cause a bug where the WeaponControl to be able to Shoot only Once

Page 7: Read mepdf v3_0_07_01rangeweaponcontrol

Accuracy

Last Updated in 2.3

With AimIK Location at its center, Accuracy calculate how much deviated will the Bullet be shot. Higher Accuracy will mean that the Bullet will strike closer to the Middle The Formula for Accuracy is UnitDexterity + Weapon’s Accuracy If the Value is >=1000, the Bullet will always hit the Center

Formula for Accuracy is in WeaponControl_Base_FireArm, Function CalcAccuracy() and CalcMaxOffset(), with tempMaxOffset determine the Maximum Deviation for the Bullet.

Page 8: Read mepdf v3_0_07_01rangeweaponcontrol

Recoil

Last Updated in 2.3

Recoil is the Effect where the Aiming got forcefully pushed upward after each Shot. Force Value inside BulletData will determine the amount of Recoil. While UnitDexterity + FireArm’s RecoilSuppress will reduce that amount To edit this Formula, go to WeaponControl_Base_FireArm CalcRecoil()

AimIK

Shot

AimIK

Reco

il

Page 9: Read mepdf v3_0_07_01rangeweaponcontrol

DualFireArm

Last Updated in 3.0

The following Conditions apply to Dual FireArms Each Weapon have their own Bullet Data and will Shoot independently In the case of WeaponReload, the following Apply If either Bullet consume Item, And either Ran out of Ammo, And there is sufficient Ammo in Inventory to do Reload, Reload will be done. Otherwise, Each FireArm will simply not shoot if there is not enough ammunition.

Page 10: Read mepdf v3_0_07_01rangeweaponcontrol

Shooting while Laying

Last Updated in 2.3

Following Weapons can do Aiming while in Laying State. Pistol, Rifle1, Rifle2 For UnderArm and OverShoulder, Character will transition to Crouch Motion if Aiming is activated If you want the Unit to Transition to Stand instead, Inside Locomotion_Crouching, ForceUnitToCrouch() Change to this instead anim.SetInteger("LocoState",(int)LOCOSTATE.STAND); To Edit which Weapon can Aim while Laying, Use Pistols Setup as Template, Add Motions accordingly Inside UnitControl_WeaponManager Edit function public bool IsCurrentWeaponAttackableWhileLaying()

Page 11: Read mepdf v3_0_07_01rangeweaponcontrol

Hand Support IK

Last Updated in 2.3

FireArm Control contain Scripts to pinned LeftHand to a certain Location

Add Transform “supportTransform” as a Child of

WeaponPrefab In certain motions inside WeaponControl_FireArm.cs function BindLeftHandToIKType1() Will determine when to pin Left Hand to supportTransform If “supportTransform_Aim” is also added, Hand will blend to that Location during Aiming and Attacking

instead.

supportTransform

Page 12: Read mepdf v3_0_07_01rangeweaponcontrol

Range Weapon Deal Damage Schematic

Last Updated in 2.3

Weapon Manager Calculate Total Damage

End of life Span?

Destroy

Instantiate Bullet with Total Atk

Target Received Damage and Calculate how much of its HP is loss based on its own internal

algorithm

YES

Bullet Hit Something

NO

NO YES

Tag Check

YES

NO

Page 13: Read mepdf v3_0_07_01rangeweaponcontrol

RangeWeapon Aiming

While Aiming, The Character will Automatically Rotate itself toward AimIK Transform

WARNING: Horizontal Aiming do not require Unity Pro, BUT Vertical Aiming utilize Animator.SetLookAtPosition(),

and Animator.SetLookAtWeight() which are Pro only features.

AimIK

Unit

Last Updated in 3.0


Recommended