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 Mr_T · Nov 30, 2010 at 02:44 AM · collisioncharactercontrollerparticles

CharacterController & Particles

Hi

I'm having fun making my first non-tutorial game with a Knight and Dragon. I would like to have the Dragon's fire particles to damage to the Knight and to have the tip of the tail do damage. I have the Knight built with a CharacterController and custom script;

Right now when the dragon breathes fire the particles collide with the Knight and jet propel the dragon backwards.

I understand that this is because the Character controller does not respond as a rigid body would. Is there a practical way around this? This is what I tried in the script that controls my knight. Flame hit is declared as a boolean false at the top of the script.

function OnParticleCollision(){

FlameHit = true;

}

and as part of function Update I have:

if(FlameHit == true){
var Knight : GameObject;
Knight = gameObject.Find("Knight6");
Knight.animation.Play("jump");
Knight.transform.Translate(0,5,-15);
FlameHit = false;
PlayerDamage++;
}
if(PlayerDamage>10){
    Knight.animation.Play("dead");
}

It all works except that the Dragon also is rocketed backwards.

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

Answer by Adam Rademacher · Nov 30, 2010 at 04:55 AM

Does the dragon have a rigidbody? It sounds like the dragon might be colliding with its own fire. Put the dragon on its own layer, then uncheck that layer from the 'Collides With' layermask on your world particle collider.

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 Mr_T · Dec 02, 2010 at 03:18 PM 0
Share

Hi

Discovered it was working, just a perceptual problem due to camera location, made it look like the dragon was moving back, when the knight really does the move. Your layers suggestion will come in handy for other things though, thanks

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

No one has followed this question yet.

Related Questions

How do I ensure collision of intermittent particles? 0 Answers

Any way to ignore collision between rigidbodies and colliders/character controllers? 1 Answer

Pong game collision problems 1 Answer

Problem with character controller and collisions 1 Answer

Check if a pre-determinated area has particles in it? 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