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 hike1 · Mar 06, 2013 at 06:50 PM · aivariableenemyparticle

Assigning a particle system to a variable

Original scripts Enemy AI http://forum.unity3d.com/threads/92021-Simple-But-Effective-AI-Script-Explained

I can't seem to track down Rob productions, he wrote this script and also 'Invasion of the Trivials'

http://www.ludumdare.com/compo/ludum-dare-23/?action=preview&uid=7405

Anyhoo, I took the player from 'Trivials' and put it in a new project, then made an enemy with the enemymood and enemytarget.js

UnassignedReferenceException: The variable hitParticles of 'enemytarget' has not been assigned. You probably need to assign the hitParticles variable of the enemytarget script in the inspector. enemytarget.Start () (at Assets/Scripts/Mobs/enemytarget.js:35)

I'm not sure how to stick the 'hit' particles prefab (or any other prefab) onto the script, there's nothing available when I try to load it from the menu, I dragged the prefab into the scene, can't drag it onto the Variable. How is this done anyway?

Thanks, Rob Productions, hope you don't mind me copy-pasting, this is one of the few games I can understand at all.

http://dl.dropbox.com/u/102638093/invasion_player.unitypackage 4.2 MB

You'll need 'Character Controllers' and 'Particles' packages added from Standard Assets

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

2 Replies

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

Answer by OperationDogBird · Mar 06, 2013 at 09:00 PM

The variable hitParticles on the enemy script expects a ParticleEmitter, make sure whatever you are trying to drag into that slot has a ParticleEmitter component. It should be that simple.

My guess is you are trying to use the Shuriken particle system (which does not have a 'ParticleEmitter' component). You can either rewrite all instance of hitParticles to use the new particle system or create a particle system the old way. Here is the reference to the Legacy particle system.

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 hike1 · Mar 08, 2013 at 03:46 PM

quote

Shuriken particle system unquote It wanted a particle emitter, thanks.

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 OperationDogBird · Mar 13, 2013 at 09:57 PM 0
Share

@hike1 Glad you got it working. Can you please accept my answer if it did indeed answer you question (this helps future lookers find the correct answer quickly).

Also, for future reference please use comments when responding (the button is at the bottom right of the question, "add new comment"). This helps keep the answers separate from questions for future viewers.

You can also use the @ character followed by the username to ensure the user gets the comment sent to their email(if they have the email option set). Happy coding :)

avatar image hike1 · Mar 15, 2013 at 03:31 AM 0
Share

@OperationDogBird, I accept your answer. If you get bored, you might want to answer why the bad guy isn't firing at the player, however this doesn't work in the demo 'isolated assault 2', which has the same A.I. I think(no source)

http://www.ludumdare.com/compo/author/someguy22/page/2/

avatar image Julien-Lynge · Mar 15, 2013 at 04:00 AM 0
Share

@hike1, You didn't actually accept the answer - you need to click the check box next to the answer to accept it. I have done that for you, but please be courteous in the future.

FYI, if you have a new question, start a new thread for it. It's bad juju (frowned on) around here to start a question in the 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

13 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 avatar image

Related Questions

How to reach multiple GameObjects' value , enemy AI 1 Answer

Make player not be seen by AI, when player in foilage and shadows. 1 Answer

Enemy AI C# 0 Answers

Enemy Avoid Terrain 0 Answers

Why doesn't this AI script work? c# 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