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 /
avatar image
0
Question by TurboHermit · Apr 12, 2012 at 08:36 PM · rotationcharactercharactercontrollermouseorbit

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.

Comment
Add comment · Show 3
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 TurboHermit · Apr 13, 2012 at 11:40 AM 0
Share

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?

avatar image JayMHelpsU · Apr 13, 2012 at 04:02 PM 0
Share

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)

avatar image TurboHermit · Apr 14, 2012 at 02:54 PM 0
Share

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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

Comment
Add comment · 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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

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


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