- Home /
Cardboard: How to get Head / Camera to inherit rotation from parent object?
I am porting my Oculus game to Cardboard, and have one final problem to solve:
The player is in a flying chair. The player moves through the world by gazing on specific objects. When moving, the chair orients to the direction of travel.
The Cardboard Head node is a child of the chair.
On the Oculus, the camera's orientation is always relative to the chair.
But, on the Cardboard, it is not inheriting the rotation from the chair. For example, when the chair turns 90 degrees left, the player in the virtual world remains facing in the same direction as he is in the physical world. I need the player in the virtual world to always be aligned with the chair he's flying on.
In other words, I need the Cardboard camera's 'Forward' to always be relative to the chair's 'Forward'.
I've tried using a target object in the Cardboard Head object, but no luck.
I'd appreciate any advice, and will reply with results.
Thanks!
Answer by toxicfrog · Nov 24, 2015 at 12:09 PM
Solved! I put the top node of the chair in the 'target' slot on the Head script. I swear I tried this before, but apparently I imagined it... So, it's working as intended now
I thought I'd solved it, but nope... It's still happening. Any advice? I've tried everything I can think of.
The Cardboard $$anonymous$$ain and Head are following the Chair's position, but they don't rotate correctly so that 'Forward' is always facing forward in the chair. It seems to rotate part of the way, but does not keep a perfect orientation with the chair, so it gets worse with every turn, until eventually 'Forward' is literally 90 degrees off (or more).
I appreciate any suggestions!