- Home /
Camera Orbit Character Rotation
Hi, I've been trying to make my own character controller using rigidbodies. This is going quite well so far, but I keep bumping into one problem.
I use the ImprovedMouseOrbit script for my camera. And this all works perfectly. The only problem is, I want my character always facing where you point your camera (third person). I'm now using:
transform.rotation.y = maincam.transform.rotation.y;
To make the character face correctly, but when you rotate to around Y 180 the character doesn't rotate with the camera anymore. If you rotate even more, it well do it again but the wrong way.
I thought this basic approach was quite solid, what am I overseeing?
I've tried this with FPSController prefab and my own character controller. So I'm pretty sure it doesn't have to do with the other scripts.
You can't child the character on the camera, because of the $$anonymous$$ouseOrbit script. This means it's kinda chasing it's own tale which will bug the crap out of it. I just found out in the inspector that's the character DOES rotate it's Y rotation further, but the object in game doesn't. Is there some kind of default rotation limit?
Is there anyway you can show me the script of the custom rotation script. $$anonymous$$aybe if you coud upload this to either a website or copy and paste into here. Thanks in advance (sorry i couldn't do it atm)
Well, I could but I found a nice work around that works just fine for me. I solved it with lookAt ins$$anonymous$$d of matching the rotations. Off course I need to flip all my art 180 degrees but that won't be a problem =P
Answer by JayMHelpsU · Apr 13, 2012 at 05:24 AM
One thing i can suggest is the player to the camera (as its parent object.) The error sounds like its the way your script is set up for rotation, it probably goes in a latitude - longtitude type format. This is when 0 is the exact center and on the opposite side is 180 as the point if that makes sense. The only other problem i could think of is if this project is for flash you will get delayed mouse movement (but this never occures to me in editor mode) Good luck :) Hope this helped
Your answer
Follow this Question
Related Questions
2D sprite rotating in 3D plane 0 Answers
Character Controller Rotation 4 Answers
Animation for turning character around on the spot,Animation for character rotating 0 Answers
rotate around character 1 Answer
rotate around character 2 Answers