- Home /
(noob question) "Looking at objects" eye effect for character/VR avatar?
Hi guys! I'm essentially a complete noobus at Unity so it's quite possible this is a dumb question, but I've been tasked with creating a particular effect and I don't have any idea where to begin and I'm basically out of my depth, I was wondering if anyone has some advice?
THE PROJECT: -A Unity 5.6.2p1 VR scene with two characters, played in Vive multiplayer (tested on Oculus while in Unity itself). -Characters are simple unrigged cartoon characters with white-with-black-dot sphere eyes. -Blocks fall from above similar to Tetris, while the players maneuver to catch them co-operatively, both holding onto the same tray. -Blocks have physics once they're on the tray.
THE DESIRED EFFECT: My boss would like the eyes of the characters to follow the nearest falling blocks, looking up/around a little to create a more lifelike appearance. I assume anything similar that also gives this appearance would also be okay.
I've looked at a number of tutorials/scripts for NPC and PC eye movement, but they're all based on realism with eyelids and all that and all I need is basically a smart orient constraint. I can't code and I'm only really familiar with Maya, so any advice is appreciated but pls be gentle I'm but a lowly scrub.
Update: Looking at the forum structures I'm not sure if this should be going into the Help Room instead? I have literally no idea how complex this problem might be though :s
Answer by theANMATOR2b · Aug 15, 2017 at 07:26 PM
Look into the built in IK tool in Unity, or an IK asset on the asset store. These are similar to maya ik tools, and "look at" constraints which are basically IK controls in 3D. This will get you started on researching the correct content to move forward with your project.
Answer by QuazarShark · Aug 16, 2017 at 07:48 AM
@theANMATOR2b That sounds like a great thing for me to start with, thank you very much! :D
I'm assuming the "look at nearest blocks" effect would be done with a script? Anyone have any advice for that?
I'm not a programmer, but I can give you a couple examples of design set up. How you choose to incorporate is totally up to you.
Their are a couple ways to make this happen, depending on your need one might be better than another. First set up is to create an area trigger/collider that makes the I$$anonymous$$ - look @ kick in when the character moves within the trigger bounds or the object moves closer to the character, so the character will only look @ an object when he moves within the range of the trigger or vis-versa.
Another method is to use ray casting to make the character look at the closest object in relation to the characters origin. Without giving a completely text book definition, ray casting shoots a ray from it's origin and can measure distance to a surface or other point in 3D space.
Another method is to script events to happen at certain times - or when a character gets close to an object. This is similar to the trigger but ins$$anonymous$$d the look @ kicks in when an event happens ins$$anonymous$$d of a volume collider controlling when the look @ happens.
Your answer
Follow this Question
Related Questions
2D eyes on 3D character? 2 Answers
Can I make animations snap to a frame? 1 Answer
3ds max Morphed animation to unity not working 2 Answers
How to select an animation clip by index number? 7 Answers
Animation Types: Humanoid vs. Generic breaking my rig 0 Answers