Projectile Scripts


(Leslie Young) #1

Projectile Scripts which allows for effects which work a bit different from what the core Skills system can handle.

Require:
plyGame 3.0.2+

Download:
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.

  • type
  • 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


(Leslie Young) #2

(Marshall Heffernan) #3

"Target To Target"
https://gfycat.com/@itsmars/detail/AgreeableObedientFlounder


(Marshall Heffernan) #4

"All From Origin Hit"
https://gfycat.com/@itsmars/detail/PotableContentBubblefish


(Sammy F Simegi) #5

Oh yes this is cool!


(daniel harratt) #6

Hi, cant get this working with latest versoin of PLYGAME… not sure if its, latest Unity 2017, PLYGAME or the Script…

Thanks


(William Ianneci) #7

Are you getting any error? If so, best to post them.


(daniel harratt) #8

no error…