Projectile Scripts which allows for effects which work a bit different from what the core Skills system can handle.
projectile_scripts-001.unitypackage (2.6 KB)
Component > Scripts > plyChainProjectile
This component should be placed on the prefab which you will be adding to the Skill’s Prefabs(s) property.
Can be use to create a chain lightning effect after the initial projectile hit.
On each of the additional hits the
On Skill Proxy Hit event will be triggered in the Blox of the Skill. This is pretty much the same as the Hit event but also sets a temporary variables called ‘proxyNumber’. This number will increase with each hit of the additional projectiles and could be used to calculate diminishing damage.
With projectiles you normally give the Skill some prefab to spawn. This prefab could be a model and some particle effect which would represent the moving projectile. When it hits the object it would be destroyed. But with this ChainProjectile the object will not be destroyed since it has more work to do (chain to new targets) but you still want the original projectile art (and particles) to go away. To achieve this the ChainProjectile will look for and disable any child object(s) it has. So, place your initial effect on child object(s) of the projectile prefab.
- TargetToTarget: the projectile jumps from one target to the other
- AllAtOnce: the projectile jumps to and originate form all targets at same time
- AllFromOriginHit: this would cause the projectiles to jump to all targets from the originally hit target - not really a chain
- maxTargets: how many targets should be found
- maxRadius: what is max radius they can be found at from the original target
- distanceEach: what can distance between possible targets be for jump
- projectileFab: prefab to spawn for the projectile(s) moving to/between additional targets
- yOffs: create and move the projectiles at this position Y offset
- speed: How fast this projectiles should move