The Hedgehog Team Community

General Category => Core Shooter Kit => Topic started by: Danielqp127 on July 29, 2016, 02:03:35 PM

Title: [Question] Disspersion effect
Post by: Danielqp127 on July 29, 2016, 02:03:35 PM
How do i create disspersion effect in bullets??
Title: Re: [Question] Disspersion effect
Post by: Nicolas on July 29, 2016, 04:26:39 PM
Hi,

A - First step is to create a simple projectile with random rotation at spawn time:
1- Create a bullet (right click in Hierarchy => Core Shooter Kit = > Weapon)
=> Add effect that you want
=> don't forget to setup the layer
2- Add Randomize Transform component on the bullet gameobject  (buton Add Component => Hedgehog Team => Helper)
=> Setup a little rotation as to -10 to 10 for each axis
3- Create a prefab of your bullet
(https://dl.dropboxusercontent.com/u/8514696/Asset%20Store/CoreShooterKit/Support/Dipersion01.PNG)

B - Second step is to create a sub weapon
1- Create an empty gameObject
2- Add SubWeapon component (buton Add Component => Hedgehog Team => Core Shooter Kit => Weapon System)
3- Drag and drop your bullet prefab into field Ammunition
4- Set Sub Emitter to cylinder with a raidus of 0
5- Set the amount that you want >0
6 Create a prefab of this sub weapon
(https://dl.dropboxusercontent.com/u/8514696/Asset%20Store/CoreShooterKit/Support/Dipersion02.PNG)

C - Thirs step is to create a projectile that use the subweapon
1- Create a bullet (right click in Hierarchy => Core Shooter Kit = > Weapon)
2- Set a lifte time near 0 (like 0.00001)
3- Drag and drop you sub weapon  into the field Sub Weapon
4- Create a prefab
(https://dl.dropboxusercontent.com/u/8514696/Asset%20Store/CoreShooterKit/Support/Dipersion03.PNG)


If you want to test it, open the example FPS, select M-16 under the player gameobject, and drag'n drop the prefab from step 3 into the field Ammuntion of the weapon component





Title: Re: [Question] Disspersion effect
Post by: Danielqp127 on August 03, 2016, 12:25:42 PM
Hi,

Thanks for the answer, the effect is very cool but it's not what i need
I want something like this

https://youtu.be/ZhINZJPZbHI (https://youtu.be/ZhINZJPZbHI)

I tried with a single bullet with RandomTransform on the Y axis, but it didn't work
Title: Re: [Question] Disspersion effect
Post by: Nicolas on August 04, 2016, 10:21:41 AM
Hi,

Do you use an existing scene to try your weapon like (third person example) ?

If yes, you need to update your prefab in the poolManager, because Unity doesn't update when a prefab is used as reference, it isn't like when you drag and drop a prefab directly in the scene.
(https://dl.dropboxusercontent.com/u/8514696/Asset%20Store/CoreShooterKit/Support/Dispersion04.PNG)
- Click on the red cross to remove the reference
- Add it again, or not, the poolmanager can be created automaticaly even if there is no reference