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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by SBull · Dec 14, 2013 at 11:56 PM · animationimportblenderexporteyes

How do you make pupils move along an oval-shaped eye?

I am using Blender to make a character with oval-shaped eyes for a game in Unity and have tried a couple of different techniques for making the pupils move along the surface so that the eyes do not pop out of the sockets when they rotate, however nothing has worked so far.

First, I tried using a lattice to stretch the eye with a damped track constraint on the eye's bone so that it rotated without losing it's oblong shape. Basically this effect.

Next, I tried using a decal attached to an empty in Blender so that it would be like animating a texture with a controlled location over the surface of the eye. Like this tutorial here.

However, when I import my model into Unity using either of these techniques it seems that Unity doesn't work with either of these methods. So what is the typical way to make a character in Unity with oval-shaped eyes? Or is Unity just not capable of doing this?

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 Kiloblargh · Dec 17, 2013 at 05:49 PM

I did my eyes by simply adjusting the mainTextureOffset, with a script to translate the direction of the object being looked at relative to the head to x and y values through trial-and-error tweaking until it looked right. Each eye is calculated independently, so they will get more cross-eyed as the look target gets closer. I don't see any reason why this would not work as well on an oval eye or a triangular eye or a rectangular eye or whatever, assuming it is UV mapped properly.

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 SBull · Dec 17, 2013 at 07:25 PM 0
Share

That sounds like what I'm looking for. I'm still on bit confused on how to implement this with a character's animations though. So do you have to control the object being looked at in Unity? Or can it follow a target animated in another 3D program?

avatar image Kiloblargh · Dec 17, 2013 at 08:06 PM 0
Share

I just made an empty transform GameObject centered on each eye and parented to the head. Then the script takes its y rotation relative to the head and uses that to offset the eyeball's texture in the x direction (look left and right) and likewise takes its x rotation relative to the head and uses it to offset the texture in the y direction (look up and down). I'm doing it with transform.LookAt, but the look-at-target null could be a child of the character's root and its position animated in 3DS$$anonymous$$ax (I have no experience importing animations) and still use LookAt in Update() to make the eyes follow it once you put it in Unity.

avatar image SBull · Dec 18, 2013 at 06:43 PM 0
Share

So you center an empty GameObject on each eye in Unity and code transform.LookAt on the empty. Then do you mean you set it so that the texture follows the rotation of the empty but appears on the surface of the eye? I'm not quite sure how to do that if that is what you mean. I should mention I'm still fairly new to Unity.

And then if you have a bone animated in 3DS$$anonymous$$ax/Blender as a target, how would you tell an object to follow that position when it's in Unity?

avatar image SBull · Jan 17, 2014 at 08:05 PM 0
Share

I just realized you can just drop the GameObject onto the bone in the armature list. But I'm still not exactly sure what the script should look like so that the texture on the eye follows the GameObject's rotation. Any tips for that?

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

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

Related Questions

Blender and unity 1 Answer

Blender to Unity animations not importing correctly 1 Answer

Renaming an animation from FBX format 2 Answers

animation blender to unity problem 0 Answers

Importing multiple objects with animations 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