Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Michael 12 · Mar 22, 2011 at 08:39 PM · errorsyntax-erroruce0001

Desintergrate Enemies on Dying

I'm not sure if many of you might remember the old "The Invaders" TV series but I'm wondering if a similar disintergration effect can be given to my Alien Zombies a short period after they have been killed. Just an idea I had, don't know if I'll actually use it. It would depend on how cool the effect was plus I was thinking it would be a cool way to rid my landscape of many dead Alien Zombie bodies lying about ;)

I applied this script from the Wiki to my Zombie Alien Dead replacement:

// simple "dissolving" shader by genericuser (radware.wordpress.com)
// clips materials, using an image as guidance.
// use clouds or random noise as the slice guide for best results.
  Shader "Custom Shaders/Dissolving" {
    Properties {
      _MainTex ("Texture (RGB)", 2D) = "white" {}
      _SliceGuide ("Slice Guide (RGB)", 2D) = "white" {}
      _SliceAmount ("Slice Amount", Range(0.0, 1.0)) = 0.5
    }
    SubShader {
      Tags { "RenderType" = "Opaque" }
      Cull Off
      CGPROGRAM
      //if you're not planning on using shadows, remove "addshadow" for better performance
      #pragma surface surf Lambert addshadow
      struct Input {
          float2 uv_MainTex;
          float2 uv_SliceGuide;
          float _SliceAmount;
      };
      sampler2D _MainTex;
      sampler2D _SliceGuide;
      float _SliceAmount;
      void surf (Input IN, inout SurfaceOutput o) {
          clip(tex2D (_SliceGuide, IN.uv_SliceGuide).rgb - _SliceAmount);
          o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
      }
      ENDCG
    } 
    Fallback "Diffuse"
  }

But I get this error: Assets/Misc Scripts/ZombieAlienDisolve.js(6,9): UCE0001: ';' expected. Insert a semicolon at the end.

Why? is it because this is not java script or something...?? Has anyone tried this out and if so how do I use this on one of my Alien Zombies?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by efge · Mar 22, 2011 at 08:56 PM

You could use the Dissolve With Texture shader from the wiki.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Michael 12 · Mar 25, 2011 at 11:28 PM 0
Share

Ooooh I REALLY like the way that looks. Something like this I think will work very well for my level 3 $$anonymous$$utants I've got planned. Thanks for updating and sharing that most AWESO$$anonymous$$E link :)

avatar image
3

Answer by flaviusxvii · Mar 22, 2011 at 08:47 PM

I've done some nice "disintegration" in the past by setting the alpha values of my textures to some kind of cloudy noise, then I'd animate the alpha threshold from 1 to 0 and the object would sort of dematerialize. I even set it up so that when the alpha value was right on the cusp of the threshold the color value would switch to a bright yellow, so it look like burning paper.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jason B · Mar 23, 2011 at 02:42 AM 0
Share

^ This is the simplest yet most effective way to do it in my opinion. And if the cloudiness isn't "disintegraty" enough, you can always up the noise level a lot, and you'll get a very sharp fuzzy disappearance. All sorts of effects can be done using fading alpha. For instance, an image that starts white on top and fades to black on bottom would make the textured object slowly disappear from top to bottom when faded.

avatar image Patyrn · Mar 25, 2011 at 10:01 PM 0
Share

I have no use for this right now, but I'm definitely filing it away as an awesome idea for later.

avatar image nielo · Aug 29, 2012 at 12:20 PM 0
Share

Hey flaviusxvii - would it be possible to share the shader you described in your answer please? What you describe is exactly what I need to do, but my knowledge of shaders is too limited at present!

avatar image
0

Answer by Alexandre Zakime · Mar 22, 2011 at 08:43 PM

You could try something with particles, it won't be THAT effect, but I think it would be cool.

When the enemy dies make a delay to start the particle system and making the enemy 'invisible' in mesh renderer, destroying it after.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by efge · Mar 22, 2011 at 08:49 PM

You could make a mix: The already mentioned Particle System and texture manipulation and some kind of "Split Effect":

var parts = GameObject.FindGameObjectsWithTag ("Part");
for (var part in parts) {
  part.AddComponent ("Rigidbody");
  part.AddComponent ("SphereCollider");
  part.rigidbody.AddExplosionForce (...);
}

You have to assign the tag "Part" to the meshes you want to split.

(just an idea)

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Michael 12 · Mar 22, 2011 at 09:19 PM 0
Share

WOW all of these sound really cool. Would either work for an FPS game? I probably should have mentioned that. I rather like that one mentioned by "flaviusxvii" about the burning paper sort of effect but I would make $$anonymous$$e like a glowing green somehow. I thought about particle effects. $$anonymous$$ost of my issue is the how to script something like this. $$anonymous$$y Alien Zombie have charatcer controller too if that plays a big difference?

avatar image efge · Mar 22, 2011 at 10:14 PM 0
Share

I use my script for as a part of an explosion effect and it works :-)

avatar image Michael 12 · Mar 22, 2011 at 10:25 PM 0
Share

Thanks efge, I suppose my other question would be, would I make my script on my character damage script or would I make something like this in their AI script, or does it make a difference?

avatar image efge · Mar 22, 2011 at 10:34 PM 0
Share

There a many ways of doing this, one would be destroying the original enemy and instantiate a special prepared one without the charatcer controller but with the effect script attached. ($$anonymous$$aybe it's time for an upvote? :-)

avatar image Michael 12 · Mar 22, 2011 at 10:49 PM 0
Share

I already have a dead replacement which is a rag doll of my alien zombie which does a nice Alien Squeel when he collapses. Video of him kickin it here: http://www.youtube.com/watch?v=$$anonymous$$JWZRwbxgoI But I'm wodering if I can further enhance that death by some of these cool ideas above?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

help with UCE0001: ';' expected. Insert a semicolon at the end 3 Answers

Editing the jumppad from the 3rd person tutorial 2 Answers

Lerpz tutorial multiple errors.HELP!!!! 4 Answers

Scripting Error when drawing texture to custom window; What am I doing wrong? 1 Answer

Collision Detector script 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges