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 Conect11 · Jan 21, 2014 at 11:42 PM · prefabrotatemouse-look

Player keeps looking down

So, I'm completely puzzled. Not even sure if I should include a script because I can't pinpoint the cause of my issue. In a nutshell:

I added a tree enabler script, and it calls from the Player Prefab. So, before using it I updated the player prefab, and that's when things went haywire. Whenever I move the player (first person controller) they rotate, almost as if the head were moving forward, toward the ground, slowly. If I disable mouse look the issue goes away, but clearly that's no solution. Am just really baffled as to what is going on. In an order to fix the problem I used Windows Restore to bring back my Prefab folder from last night, but the same issue now continually happens. Has anyone seen this before? Any help is greatly appreciated. Thanks, and God bless.

EDIT:

Including tree enabler script.

Sorry about that. Should have included before. I'd gladly give more info, if I could figure out which info to include. Just so puzzled by this new issue that I don't even know where exactly to begin. Thanks for your patient help.

 #pragma strict
 var player                : GameObject;
 var turnOnDistance        : float = 500;
 private var playerPos    : Vector3;
 private var treePos        : Vector3;
 function Start () 
 {
 
 }
 
 function Update () 
 {
     playerPos = player.transform.position;
     treePos = gameObject.transform.position;
     if(Vector3.Distance(playerPos,treePos) < turnOnDistance)
     {
         gameObject.SetActive(true);
     }
     else
     {
         gameObject.SetActive(false);
     }
 }
Comment
Add comment · Show 5
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 getyour411 · Jan 21, 2014 at 11:54 PM 0
Share

Look at the camera associated to FPC usually a child; does it have a weird location or rotation

avatar image RyanZimmerman87 · Jan 22, 2014 at 12:04 AM 0
Share

You should try to include some more details so people can help you easier.

I'm not sure what a tree enabler script is so that's a problem for suggesting an accurate solution.

But it sounds to me that you need to double check the child objects associated with whatever is tilting like getyour411 suggested.

It also could be related to gravity if the whole character is just slowly falling over.

avatar image Conect11 · Jan 22, 2014 at 12:16 AM 0
Share

thanks to both of you. It appears it's the camera, not the entire player that's slowly rotating forward.

avatar image dscroggi · Jan 22, 2014 at 12:29 AM 0
Share

might need to see some other related scripts like camera/player. TreeEnabler seems to be fine

avatar image Conect11 · Jan 22, 2014 at 12:33 AM 0
Share

I agree, Tree Enabler didn't seem to show any issues inside the script. That said, I literally changed nothing else. No changes to the camera, the player, or any associated scripts, etc.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Conect11 · Jan 22, 2014 at 02:16 AM

so... ummm... the cord to my controller had gotten eaten by my chair leg. Once I fixed that the issue went away....

Walk of shame...

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

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can't use camera.main [SOLVED] 1 Answer

third person controller and mouse look 1 Answer

Trouble rotating a prefab while it's moving up,Rotating an object with an animation while it moves up 0 Answers

Use prefab as particle in particles system 0 Answers

Rotate object 1 Answer


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