First person with head movement
Hi all,
Bit of a tricky question here I fear. But it may not be so as I've seen it done in a few demos, and I'm still fairly new to Unity. Basically, I am trying to program a first person game with Rift support in mind. In this game I want to render the main character under the camera so that you can see your 'body' using the Rift. I've also implemented a large mirror to test if this works. My setup is as follows:
- Player object (mesh, controller and animations) + first person controller scripts from the standard assets pack
-- OVRCameraController attached to the head
--- Invisible target object parented a distance away from the head (rotates with the head movement)
This setup works as far as simple walking/running/jumping animations, but moving the camera doesn't affect the mesh in any way. So I found a head movement script from here: http://blogs.unity3d.com/2009/07/10/just-looking-around/ which is designed with third person games in mind. I attached this to my player and set the invisible target object as the target transform, then adjusted the following values in the script (see the above link for reference on what each one does):
- First transform: neck
- Last transform: head
- Threshold angle difference: 0 (no minimum angle before movement occurs)
- Bending multiplier: 1 (head should always look directly at target)
- Max angle difference: 90 (default, shouldn't make a difference as this will never be reached)
- Max bending angle: 80 (degrees in each direction)
- Responsiveness: 100 (no delay in head tracking)
However, nothing appears to be happening. I'm wondering if anyone has used this script in their game before, or whether there is another method I can try? For an example of what I'm after, the Minecrift implementation is perfect. And though I haven't tried it yet, I imagine the Tuscany girl demo would have the same setup.
Any thoughts? Thanks in advance!
Adam ~
Bit of a tricky question here I fear. But it may not be so as I've seen it done in a few demos, and I'm still fairly new to Unity. Basically, I am trying to program a first person game with Rift support in mind. In this game I want to render the main character under the camera so that you can see your 'body' using the Rift. I've also implemented a large mirror to test if this works. My setup is as follows:
- Player object (mesh, controller and animations) + first person controller scripts from the standard assets pack
-- OVRCameraController attached to the head
--- Invisible target object parented a distance away from the head (rotates with the head movement)
This setup works as far as simple walking/running/jumping animations, but moving the camera doesn't affect the mesh in any way. So I found a head movement script from here: http://blogs.unity3d.com/2009/07/10/just-looking-around/ which is designed with third person games in mind. I attached this to my player and set the invisible target object as the target transform, then adjusted the following values in the script (see the above link for reference on what each one does):
- First transform: neck
- Last transform: head
- Threshold angle difference: 0 (no minimum angle before movement occurs)
- Bending multiplier: 1 (head should always look directly at target)
- Max angle difference: 90 (default, shouldn't make a difference as this will never be reached)
- Max bending angle: 80 (degrees in each direction)
- Responsiveness: 100 (no delay in head tracking)
However, nothing appears to be happening. I'm wondering if anyone has used this script in their game before, or whether there is another method I can try? For an example of what I'm after, the Minecrift implementation is perfect. And though I haven't tried it yet, I imagine the Tuscany girl demo would have the same setup.
Any thoughts? Thanks in advance!
Adam ~
