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 Ckmlee · Mar 21, 2013 at 10:07 PM · physicsparticle systemmayaliquid

Creating an octopus / squid that spits ink with a particle system?

I am a newbie in unity and have not much experience in scripting. I have modeled an octopus using maya, and imported into unity. I wanted to have the octopus to spit ink when the first person controller approach it. I planned to do it with the triggered animation and a particle system. Is that a good way to do it? How can create the physics of the liquid ink projected out powerfully?

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

1 Reply

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

Answer by Willium_Bob_Cole · Mar 21, 2013 at 11:52 PM

Use GameObject > Create Other > Particle System to create your own. There are a ton of options and things to play around with though, and if it seems daunting, import the standard asset folder "Particles" and use some pre built ones, play with the settings on those to get different effects. You will notice they will often have different layers, so one layer could be big, slow moving white particles for smoke, with lots of small, faster moving particles in the middle for the fire. When I first used Unity particle systems, I took a standard fire particle system, and tweaked it until I got a nice, cartoon style, almost volumetric flame, blue in colour, that acted as the head of a character my friend was making. I had to make the speed and death rate quite high to keep the particles as close together as possible so the head didn't become a long blue trail as the character walked around.

Basically, just play with it, particles can be fun! Just be sure to only use them when necessary, I have seen people instantiate one particle system after another, for rocket launchers etc, and if they are not properly killed, they will cause all sorts of problems, as they could be taking up valuable memory and processing power when you don't need them any more.

Comment
Add comment · Show 8 · 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 Ckmlee · Mar 24, 2013 at 04:33 AM 0
Share

Thanks a lot man! I played with particle system and managed to create something close to spiting ink. Then I wanted it to have a triggered zone. So the octopus will only spit ink when the player is close to it. I found the script and learned that I need a mesh emitter, particle renderer and particle animator. The $$anonymous$$esh emitter's properties are very different from the particle system. I played with the emitter for 2 days, and still could not figure out how to create the ink / smoke effect. The particles are just appearing at blocks of dots. The trigger zone is also not working. What values should I put in for the particle emitter? Any suggestion?

avatar image Ckmlee · Mar 24, 2013 at 05:02 AM 0
Share

Thanks a lot man! I played with particle system and managed to create something close to spiting ink. Then I wanted it to have a triggered zone. So the octopus will only spit ink when the player is close to it. I found the script and learned that I need a mesh emitter, particle renderer and particle animator. The $$anonymous$$esh emitter's properties are very different from the particle system. I played with the emitter for 2 days, and still could not figure out how to create the ink / smoke effect. The particles are just appearing at blocks of dots. The trigger zone is also not working. Any suggestion?

avatar image Chronos-L · Mar 24, 2013 at 05:21 AM 0
Share

Hi, @ckmlee,

This would be another question, because you are talking about setting up a trigger to control the particle emission.

You should mark @willium-bob-cole's answer correct, if it is to you. Close this question, open up another question with details on your current problem.

avatar image Willium_Bob_Cole · Mar 24, 2013 at 12:54 PM 0
Share

If your particle system looks right, then you don't need to add anything else such as mesh emitter etc, all those things should be included as long as it looks right in the editor.

The way I do trigger volumes is to create a box, and tick 'is trigger' in it's inspector properties, then make a trigger material that can be whatever colour you want but make it semi transparent, that way you can still see, move, and resize it in the editor, without covering up the rest of your level. Next, make a triginvis script that you apply to any trigger you make so it isn't visible when you play the game. If you are using javascript, it will be:

 function Start()
 {
    renderer.enabled = false;
 }


Simples. You can also prefab this so you can use as many triggers as you need quickly and easily. Then, for each trigger that you need to actually do something, make a new script, using function OnTriggerEnter() and tell it what to do. So to enable your particle emitter, use:

 var SquidInk : ParticleSystem;
 
 function OnTriggerEnter()
 {
    Emit();
 }
 
 function Emit()
 {
    SquidInk.Play();
    yield WaitForSeconds(3);
 }

Just be sure that your particle system is not set to loop and this should be good to go. to assign your particle system to the variable SquidInk, you need to either drag it from you assets browser into the SquidInk slot on the trigger's inspector window, where your script will now be, or, you can click the little dot next to this variable in the inspector, and assign it through the pop up.

Hope this helps, it should work fine but if it gives any errors let me know!

avatar image Ckmlee · Mar 24, 2013 at 09:34 PM 0
Share

Thanks Willium_Bob_Cole!

So I created a capsule collider for that ink prefab that I have and dragged it to the scene. I also added in your script and dragged the ink prefab as its required particle system. However, I got an error saying :

nullreferenceException: Object reference net set to an instance of an object. UnityEngine.ParticleSystem.Play (Boolean withChildren)

Show more comments

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

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Unity reading animations incorrect when constraints used 0 Answers

water slide mini game unity 2 Answers

Why is there no gravitational acceleration with Unity 4.3.1 2D? 0 Answers

Simple Maya/Unity question. How do I flip a cube inside out to make a room? 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