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 G-rant · Mar 11, 2012 at 03:29 AM · shadowlookatprojectorblob

Projector LookAt Player

I didn't want my player's blob shadow to look directly down at him, so I put the projector at the same position as the light and used LookAt to make it look more real, but it twitches out. It randomly looks downward.

 var Player : Transform;
 
 function FixedUpdate () {
 transform.LookAt(Player);
 }

The player makes particles and has a character controller. I don't know if those would effect any thing, because I'm new to Unity.

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

2 Replies

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

Answer by G-rant · Mar 12, 2012 at 12:41 AM

I turned on "Is Kinematic" on the Rigidbody Component to fix it.

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 Kleptomaniac · Mar 11, 2012 at 04:21 AM

I believe your problem is that you have put this in FixedUpdate (). FixedUpdate is framerate independent, as is explained here, and is called at fixed intervals as is defined at Edit > Project Settings > Time > Fixed Timestep. Its main purpose is for physics calculations, and unless it is absolutely necessary, should only ever be used for physics calculations.

In short, your LookAt is twitching because it is running at intervals independent of the framerate. In order to run every frame and in this case, you would instead use Update ().

Hope that helps, Klep

Comment
Add comment · Show 6 · 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 G-rant · Mar 11, 2012 at 06:21 AM 0
Share

Thanks, but I originally had the code in the normal Update and not FixedUpdate, but I tried it again anyways, and it still didn't work. It seems to only happen to the player object(and it's child objects), but it works with the other objects. It is still looking at the player, but it looks downward on the x axis a little, but not strait down.

avatar image Kleptomaniac · Mar 11, 2012 at 09:22 AM 0
Share

Hmm, I just tested this code and it works fine for me. The only aspects that were different were the fact that you are using a blob shadow projector and a rigidbody. Which raises the question, why are you using a rigidbody on your player? I presume that you are using the standard First Person Controller since you're using a Character Controller. Furthermore, why have you got it set to is$$anonymous$$inematic? I'm not sure if this would have an effect on the blob shadow projector, seeing as I've never used it, but perhaps some more information would be helpful.

$$anonymous$$lep

avatar image G-rant · Mar 11, 2012 at 01:57 PM 0
Share

Putting it in Is $$anonymous$$inematic fixed the problem. I edited solved in the question name, but it didn't change.

avatar image Eric5h5 · Mar 11, 2012 at 01:59 PM 0
Share

You don't put "solved" in the question title, you accept the answer by using the checkmark. (Currently editing is broken and it takes changes quite a while to show up.)

avatar image G-rant · Mar 11, 2012 at 02:05 PM 0
Share

Okey, but his answer wasn't what solved my problem.

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

6 People are following this question.

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

Related Questions

How to make a blob shadow project from a fixed angle as the object rotates? 2 Answers

Blob Shadows - Reversing Shadow Effect? 2 Answers

Blob shadow projector is not projecting properly 2 Answers

Blob shadow changes transparency 2 Answers

Do blob shadow projectors work on iPhone? 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