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 SpectreX · Aug 19, 2014 at 10:37 PM · fpsparticles

Is it possible to attach extra variables to a particle via a script?(such as damage done)

I'm trying to make a game with somewhat realistic ballistic physics and I want to know if/how it's possible to attach something such as a damage value that's accessible by a receiver (a character that is hit). I'm using the shuriken particle system right now.

Comment
Add comment · Show 2
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 Kiwasi · Aug 19, 2014 at 10:55 PM 1
Share

It should be possible to create a particle data class that contains a reference to the particle and the other information you need.

Not sure if it can actually be attached to an individual particle, but you could manage everything from the particle system.

avatar image Lu27 · Mar 07, 2016 at 10:43 AM 0
Share

hi. i know this thread is quite old, but i need the exact same thing. I looked desperately all over the internet and nobody seems to have / understand this problem. This is the only thread that asked the right question. also screenname_taken doesn't seem to understand the problem. I do NOT want to calculate the damage by velocity, I do NOT want to hack the value into some unused property like startSpeed and I can NOT put the value on the caster, since it's possible that it changed between cast and hit. Since your original post is more than a year old: have you found any solution to yourself? Any help appreciated.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by screenname_taken · Aug 19, 2014 at 10:49 PM

http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnParticleCollision.html

Comment
Add comment · Show 2 · 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 SpectreX · Aug 19, 2014 at 11:03 PM 0
Share

I have looked at the docs, but I haven't found anything alluding to the possibility of sending custom variables with the particle for a particle collision. I was thinking that maybe there's a way around it, such as attaching a script to the particle system and maybe backtracking from the collision event to the particle system and taking the script component and thereby getting access to the damage variable

avatar image screenname_taken · Aug 20, 2014 at 01:30 PM 0
Share

I lost you a bit there. What do you mean custom variables? The second script at the link i've sent you shows how you can use a script, Shuriken particles and a collider, that in the even of particle collision something happens. What happens is up to you.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

best free fps assets 2 Answers

How do i get a weapon to follow the first person controller up and down? 0 Answers

Unity FPS question 0 Answers

Hello guys I made combined simple code from codes i found on unity forums (I suck at programming) ^^, but i have a problem my tower was shoting repeating after 2 secs but it stopped and i don't know how to make this back can you help me? 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