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 Ted-Brown · Aug 23, 2011 at 12:39 AM · shadowprojectorblob

Shadow Projector Component not pointed down

Hi all,

I am trying to get drop shadows on my prefab characters. I've already imported Blob Shadow et al from Standard Assets.

I have 10 characters running around at once, so I attached a Projector component to the character's prefab, then gave it the shadow material. Unfortunately, it's pointed straight out, instead of down!

When I go into an update routine and try this:

 var proj : Projector = GetComponent (Projector);
 proj.transform.rotation.eulerAngles.x = 90;

It rotates the parent object! (which is not a Projector, BTW. =D )

I tested to see if there was a transform on the projector using this line of code:

 if (proj.transform == null) print("null");

But it never printed, making me think it does have a transform.

So... if you know of a different way to get a standard blob on multiple characters, or know what I'm doing wrong here, please let me know!

Thank you!

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
Best Answer

Answer by Waz · Aug 23, 2011 at 01:18 AM

The Projector is a component on a GameObject. The GameObject has a Transform. Components do not themselves have a Transform. Look in the Inspector and this will become clear.

If you only want to rotate the Projector and not the whole GameObject it is on, then put it on a child of that game object and rotate the transform of that child object.

To make a child object, Create Empty and drag it to the parent object.

Comment
Add comment · Show 4 · 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 Ted-Brown · Aug 23, 2011 at 01:52 AM 0
Share

I see that now; the Standard Asset was just a prefab. O$$anonymous$$. New knowledge, thanks!

Still having an issue, though... :(

I created a "DropShadow" prefab thus:

  1. Project -> Create -> Prefab

  2. Game Object -> Create Empty

  3. Select new object -> Add Projector component

  4. Change material to shadow

  5. Drag object to prefab

  6. Delete game object

  7. Test prefab by dropping into scene. Works! O$$anonymous$$.

Added to game object thus:

  1. In script (not sure how to mark code blocks in replies): var shadowObj : GameObject;

  2. Dragged "DropShadow" prefab to its place in the Inspector

  3. In the Update function for the object: shadowObj.transform.position = transform.position; shadowObj.transform.position.y += 2;

Aaaaand... nothing! :( Did I overlook something fundamental?

avatar image Waz · Aug 23, 2011 at 12:21 PM 0
Share

The only useful thing to do with a Prefab dragged to a script variable is to Instantiate it in that script.

So either do that or drag a real scene object to that slot, not the prefab from which it was made.

avatar image Ted-Brown · Aug 23, 2011 at 03:49 PM 1
Share

Yes, that was the issue. Learning is FUNdamental, eh? Ehhh??

But seriously, thank you!

avatar image Waz · Aug 23, 2011 at 09:37 PM 0
Share

Thank you for learning, that's what this place is all about!

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

Blob shadow projector is not projecting properly 2 Answers

Blob shadow changes transparency 2 Answers

Do blob shadow projectors work on iPhone? 1 Answer

[Unity3D 3.5.6f4] Get rid of shadow projector artefact 1 Answer

Projector (Blob Shadow) does not work properly 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