Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 DayyanSisson · Aug 19, 2011 at 06:02 AM · particlesparticlesystemspacespaceshipshield

How to Create Shields

I'm making a Space Sim and the starships/capital ships need to have shields. So what I tried to do is create a duplicate of the object make it slightly bigger, and added a transparent blue material to the shields to make it shield like, and so you can see the main ship under. The problem was, now the ship is slightly tainted blue, so I wanted a shield that was invisible, but when a laser hits it, blue particles appear in the area that it collided in. I've looked at the other question liked this, but It didn't make sense to me, so I wanted a way similar to my approach. Can anyone help? Thanks in advance

Comment
Add comment · Show 7
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 CHPedersen · Aug 19, 2011 at 07:07 AM 0
Share

What you have there, with the slightly larger model, sounds like a good approach as it is, so the way I read your problem, you're basically looking for a way to emit particles at a particular position (the impact position of the laser)? You can do that with a standard particle system where you have the emitter disabled, so it doesn't automate a constant emission of particles. I assume you're using a Raycast and a RaycastHit object to deter$$anonymous$$e whether a laserblast hit the shield or not. The RaycastHit object that gets returned contains the point of impact, in world coordinates. You can pass that point along with Color.Blue into the emitter's manual emit function, see here:

http://unity3d.com/support/documentation/ScriptReference/ParticleEmitter.Emit.html

This causes it to emit 1 particle at that exact point. For visuals, call it 10-20 times in a row with a slight, randomized offset around the laser impact point obtained from the raycast.

avatar image DayyanSisson · Aug 19, 2011 at 07:11 PM 0
Share

Actually I'm using simple colliders to see if it hits the target. And I think I answered my own question... with a question. Is there a way for me to have different type of explosions depending on what I hit? I'm working on a script for that now but, I just want to know if that is even possible.

avatar image stopsecret · Aug 19, 2011 at 08:42 PM 0
Share

You can use tags, or the collider you hit's material, to identify it.

avatar image DayyanSisson · Aug 19, 2011 at 09:12 PM 0
Share

That's what I'm trying, I'll post the finished code when I finish it (obviously).

avatar image Bovine · Aug 19, 2011 at 09:58 PM 0
Share

You might want to consider writing a shader to draw the shield on the larger object. That's a big task and I'm no shader guru but I imagine it would be possible. I offer it as a suggestion for further research :-)

Show more comments

2 Replies

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

Answer by DayyanSisson · Aug 22, 2011 at 05:51 PM

Check my other question because if you're taking the same approach as me, it answers this question. Thank you everyone who helped me. Different Explosions For Different Collisions

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 Bravini · Aug 20, 2011 at 03:17 PM

I'd probably do as follow : set your shield's renderer to false, give it a sphere collider and set its isTrigger to enabled. Now make a script with a function OnTriggerEnter and inside it call the function Overlap Sphere that will return all the colliders inside a given radius (your shield's radius). Get the inverse direction of the colliders and instantiate a prefab particle system containing the desired effect you want. Finally, destroy the gameobject of the collider. You will also have to filter when the overlap sphere is called and the effect to happen only with enemy bullets, but that is simply a compare tag call.

I'm not sure if this is the best way to do it, but it's actually fast enough.

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

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

8 People are following this question.

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

Related Questions

How to use individual Particles as objects 1 Answer

How to make Particle System spiral/vortex 1 Answer

Particles that only show in light 2 Answers

Change Size over Lifetime for Particle System? 1 Answer

Particle System Emission Rate Scriptt 0 Answers


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