• 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
2
Question by puesnue · Sep 26, 2012 at 03:07 AM · physics

BLOOD, BREATH & SWEAT & swears F%*$#$@!*;^%!!!!!

The setting is a winter scenario. I am trying to create footprints in snow, ice breath and periodically a blood trail on top of the footprints. I know that there is a package out there for a winter game walk-through but I want to build this from the ground up to learn Unity. I am a game artist and not so great at c# or JavaScript but I can muddle through it. I was looking at the "projector" in Unity and also considering Trail Renderer or Line Renderer but I am new to Unity and have been struggling. I thought maybe a texture with an alpha channel and a bump map would do the trick but I quickly realized that I need 2 at different locations and intervals and they need to disappear after a segment of time has passed. I tried a projector but it seems to be tied to the First Person Controller. If I could delay the projector and have it follow the FPC while projecting a texture material it might be an easy solution. But, I have got a feeling that this is going to take some complex code tweaking. I think the breath could be easier using a particle emitter tied to the FPC? But I am just speculating as I have only worked with Unity for a few hours. I would be grateful for any suggestions or ideas from my skilled and knowledgeable colleagues here at Unity Developer Network.

(addendum) I have very little programming skill but I'm a quick learner. I've worked with AS3 and simple 2D physics in Flash and I can pick apart the scripts. It seems like a difficult problem but I am hoping I don't have to go to school (computer science) for eight years to accomplish this effect. I am willing to work and I am pretty smart, just don't know where to begin and what method might be most efficient.

Thank you.

Tony

Comment
Add comment · Show 4
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 AlucardJay · Sep 26, 2012 at 03:08 AM 3
Share

hey there, fully understand the frustration, but a better title that describes the problem would get more traffic, good luck =]

avatar image Khada · Sep 26, 2012 at 04:08 AM 1
Share

$$anonymous$$y personal opinion is that this approach will lead to endless headaches. You really need to start from the ground up if you want to take on the challenges that fall within a programmers field of expertise. If you want to be able to do this stuff on your own, time to learn to code. If not, time to get a programmer.

avatar image Fattie · Sep 26, 2012 at 10:37 AM 0
Share

FYI Trail Renderer or Line Renderer are totally unrelated, forget those.

So you want to learn some program$$anonymous$$g, that's great.

For this, learn everything you can about DECALS. That's one of the classic solutions for blood splatters. Learn about projectors, but probably not exactly what you want here.

The one word answer here is "learn about decals".

I definitely want to encourage you to learn program$$anonymous$$g as a hobby, but you should realise that what you are describing is achieved in game productions using 10, 20, or 50 engineers (not "guys who know some javascript" ... actual engineers) who work on tasks like this for months or a year.

"got a feeling that this is going to take some complex code tweaking" No, it would take a seasoned mature software engineer, who also has a few yrs experience with Unity, as a big freelance project!

avatar image Fattie · Sep 26, 2012 at 10:42 AM 0
Share

also consider just get one of the many "decal kits" or "bloody kits" or "snow footprint kits" from the Asset Store. it's a great way to get in to programmign gently.

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by fafase · Sep 26, 2012 at 06:47 AM

This would take a little while to provide code so I will only give you some headlines.

As stated in comments, you are heading into hours of headache if you do not know much about programming.

Your footsteps could be done using the animation event

http://docs.unity3d.com/Documentation/Components/animeditor-AnimationEvents.html.

Since you are a game artist, I reckon you are familiar with animation.

All you need to do is add a function when the foot animation curve is at the lowest(touching ground). Then you create a footstep texture that you apply flat on the ground at the foot position. Same for the bloody one, you just swap the material. You can use the Destroy function to remove your footsteps as the function has a timer in seconds.

The function below shows the principle with the mouse position, you just need to change for the foot position. Click left button to apply a "step", wait for 5 seconds and pooof...it is gone.

 var step:GameObject;
 var bloodyStep:GameObject;
 var ok:boolean = true;
 
 function Update(){
     if(Input.GetKeyDown(KeyCode.Space))ok=!ok;
     if(Input.GetMouseButtonDown(0)){
         var ray : RaycastHit;
                 if (Physics.Raycast (Camera.main.ScreenPointToRay (Input.mousePosition),ray)) {
                     if(ok){
                         var steps=Instantiate (step, ray.point, Quaternion.identity);
                         Destroy(steps,5.0f);
                     }else{
                         var blSteps=Instantiate (bloodyStep, ray.point, Quaternion.identity);
                         Destroy(blSteps,5.0f);
                     }
                 }
         }
 }

link text

You can try a very simplified version with the link at the bottom. Press space to swap colors.

For the breath, you use particle emitter that is position on the front of the mouth.

http://docs.unity3d.com/Documentation/Components/class-EllipsoidParticleEmitter.html

Unity has two particle system, legacy and shuriken. I would recommend legacy to start with. Shuriken has so many parameters that would get you lost.

I would tell you to start and look for all those and when you hit an issue come back here.


unity.zip (58.7 kB)
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
1

Answer by DaveA · Sep 26, 2012 at 07:03 AM

fafase has good advise.

You might also apply Decal textures for both footprints and blood. If you use a parallax shader with height you can get a pretty nice 'impression'

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 puesnue · Sep 26, 2012 at 12:18 PM

Thank you! thank you Fattle and Dave. And thank you for considering my "right brain" visual thinking mind. I think that I can do this and I appreciate the advice very much. Well, here we go...

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 fafase · Sep 26, 2012 at 12:19 PM 0
Share

You're welcome...

avatar image
0

Answer by TurboHermit · Sep 26, 2012 at 01:10 PM

I'd use a particle system that collides with your ground and uses gravity.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

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

Related Questions

2D 360 degress platformer example needed 0 Answers

Punching a crate 0 Answers

Two Bone IK constraint with more than 2 bones on my arm. 0 Answers

HOW DO I USE RAYCASTHIT 2D???? 1 Answer

Is it possible to get rope physics? 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