News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • May 21, 2018, 03:18:13 AM

Login with username, password and session length

Author Topic: [Question] Disspersion effect  (Read 893 times)

Offline Danielqp127

  • Newbie
  • *
  • Posts: 3
[Question] Disspersion effect
« on: July 29, 2016, 02:03:35 PM »
How do i create disspersion effect in bullets??

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: [Question] Disspersion effect
« Reply #1 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


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


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



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





« Last Edit: July 29, 2016, 04:28:55 PM by Nicolas »

Offline Danielqp127

  • Newbie
  • *
  • Posts: 3
Re: [Question] Disspersion effect
« Reply #2 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

I tried with a single bullet with RandomTransform on the Y axis, but it didn't work

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: [Question] Disspersion effect
« Reply #3 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.

- 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