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 Ilias · Jun 26, 2011 at 11:32 PM · shadowthird-person-shooter

3rd person shooter shadow problem

Hi everyone.

I'm using the 3rd person shooter of unity 3, but now i removed the direction lights of the scene and placed point lights. And when my player died, Unity gives me a error:

 NullRefenceException
 CharacterShadow.LateUpdate ()(at Assets/Demo Scene Script/CharacterShadow.cs:168)

What should i do te fix it? Someone can help me?

**EDIT:*

The error says something about this line

             child.camera.targetTexture = shadowmap;            
         Projector proj = (Projector)child.GetComponent(typeof(Projector));
         proj.material.SetTexture("_ShadowTex", shadowmap);
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
1

Answer by Waz · Jun 26, 2011 at 11:55 PM

Look at that line of code. You'll find it trying to find the direction of the directional light, which you have deleted, hence this error. How do you want the shadow to look with your lights?

Comment
Add comment · Show 9 · 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 Ilias · Jun 27, 2011 at 02:46 PM 0
Share

Okay i understand it right now, but what should i do then? But what do you mean with, How do you want the schadow to look with your lights?

I'm using pointlights, so i don't know. It's a building with PointLights.

avatar image Waz · Jun 28, 2011 at 07:45 AM 0
Share

You really need to be able to follow the compiler's complaints yourself. You are given the line number, you have the code, a "Null Reference Exception" means you're trying to access something (eg. that child variable or the camera the code refers to). Somehow you've busted one of those. Look back in the code.

Otherwise, don't try hacking on code you download until you understand the code. The demos as tutorials are there to $$anonymous$$ch you, not to give you a start towards a game.

avatar image Ilias · Jun 28, 2011 at 09:47 PM 0
Share

But i want to discover and develop my experience with Unity, So that's why i'm asking this question to know how to work on a project on my own and to know what's wrong if i have the same problem.?? :S

This is why i'm asking. Why are these tutorials here, were are they for? I think to learn about Unity. So how can i make a new project without experience???

avatar image Waz · Jun 28, 2011 at 10:36 PM 0
Share

The most you should do with a tutorial is add a couple of features, perhaps ones suggested in the tutorial's docs. Then you should do another tutorial, then another. Then you should start from scratch and make something very simple but using the knowledge you have learned from doing the tutorials. Stop that project when you have learned enough, and start another more complicated. Repeat until what you're making is awesome.

This might seem a longer path. But it's the only one that goes anywhere.

See how this person is just making very small things to start.

avatar image Ilias · Jun 28, 2011 at 11:08 PM 0
Share

Okay, that is his own way to discover Unity and i'm do it on my own way. Do you want to answer my question? Yes or No. I would like to receive answers. Not to $$anonymous$$ch me what i should to do with Unity.

Show more 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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Unity Indie and Static Shadows 3 Answers

Can transparent textures be lightmapped? 2 Answers

No real-time shadows after porting to Unity 3 1 Answer

CharacterShadow script with transparent cutout shader 0 Answers

How to use a shadow projector 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